Find file History
Latest commit 96d7a25 Nov 5, 2016 @tipsy tipsy Update jinjava engine
Permalink
..
Failed to load latest commit information.
src Update jinjava engine Nov 5, 2016
LICENSE added handlebars template engine Aug 20, 2014
README.md Fixes copy paste typo. Dec 7, 2015
pom.xml Update jade engine Nov 5, 2016

README.md

spark-template-handlebars

Spark templating system using handlebars.java

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

import spark.ModelAndView;

import static spark.Spark.get;

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

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