Created
January 9, 2013 02:02
-
-
Save karad/4489930 to your computer and use it in GitHub Desktop.
Play 2.0 JavaでScalateを使いたい場合はorg.fusesource.scalate.japi.TemplateEngineFacadeを使えばプラグインなしでいける。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package controllers; | |
import play.*; | |
import play.mvc.*; | |
import controllers.*; | |
import views.html.*; | |
import org.fusesource.scalate.japi.TemplateEngineFacade; | |
import java.util.HashMap; | |
import java.util.Map; | |
public class Application extends Controller { | |
public static Result index() { | |
Map<String, Object> map = new HashMap<String, Object>(); | |
map.put("name", "__name__"); | |
map.put("title", "__title__"); | |
map.put("request", request()); | |
TemplateEngineFacade engine = new TemplateEngineFacade(); | |
return ok(engine.layout("app/views/" + "scalate.mustache", map)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment