From d34261dc4403dca6c32a4ea9cfa3fdf2ee08282e Mon Sep 17 00:00:00 2001 From: Digital-Chaos Date: Sat, 18 Mar 2017 17:20:12 +0000 Subject: [PATCH] Update README.md Added example for Maven and Spring configuration. --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 03899e9..a258494 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,40 @@ spring-rythm ============ Enable SpringFramework application developer to use Rythm template engine + + +Maven dependency +---------------- + + org.rythmengine + spring-rythm + 1.0 + + + +Example Configuration +--------------------- + + @SpringBootApplication + public class DemoApplication { + @Bean + public RythmConfigurer rythmConfigurer(){ + RythmConfigurer rythmConfigurer = new RythmConfigurer(); + rythmConfigurer.setResourceLoaderPath("/templates"); + rythmConfigurer.setDevMode(true); + return rythmConfigurer; + } + + @Bean + public RythmViewResolver rythmViewResolver() { + RythmViewResolver viewResolver = new RythmViewResolver(); + viewResolver.setCache(true); + viewResolver.setSuffix(".html"); + return viewResolver; + } + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + } +