Find file History
Latest commit 96430ec Nov 5, 2016 @tipsy tipsy Update mustache engine
Permalink
..
Failed to load latest commit information.
src
LICENSE added mustache template engine May 13, 2014
README.md fixed readmes Sep 16, 2015
pom.xml Update mustache engine Nov 5, 2016

README.md

spark-template-mustache

Spark templating system using mustache.java

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

import spark.ModelAndView;
import spark.template.mustache.MustacheTemplateEngine;

import static spark.Spark.get;

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

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