Find file History
Latest commit 0fc324e Nov 5, 2016 @tipsy tipsy Update pebble engine
Permalink
..
Failed to load latest commit information.
src Update pebble engine Nov 5, 2016
README.md Redo pebble templating, correctly this time. Apr 14, 2015
pom.xml Update pebble engine Nov 5, 2016

README.md

spark-template-pebble

How to use the Pebble template route for Spark example:

import spark.ModelAndView;
import spark.template.pebble.PebbleTemplateEngine;

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

import static spark.Spark.get;

/**
 * @author Nikki
 */
public class PebbleExample {

    public static void main(String[] args) {
        get("/hello", (request, response) -> {
            Map<String, Object> attributes = new HashMap<>();
            attributes.put("message", "Hello World!");

            // The hello.pebble file is located in directory:
            // src/test/resources/spark/template/pebble
            return new ModelAndView(attributes, "hello.pebble");
        }, new PebbleTemplateEngine());
    }
}