Find file History
Latest commit 56f378a Nov 5, 2016 @tipsy tipsy Update thymeleaf engine
Permalink
..
Failed to load latest commit information.
src Update thymeleaf engine Nov 5, 2016
LICENSE thymeleaf Sep 16, 2015
README.md thymeleaf Sep 16, 2015
pom.xml Update thymeleaf engine Nov 5, 2016

README.md

spark-template-thymeleaf

Spark templating system using thymeleaf

import java.util.HashMap;
import java.util.Map;

import spark.ModelAndView;

import static spark.Spark.get;

/**
 * Thymeleaf template engine example
 */
public class ThymeleafTemplateExample {
    public static void main(String[] args) {
        Map map = new HashMap();
        map.put("name", "Sam");

        // hello.html file is in resources/templates directory
        get("/hello", (rq, rs) -> new ModelAndView(map, "hello"), new ThymeleafTemplateEngine());
    }
}