[bs-120] Support for groovy templates
* Added GroovyTemplate.template() utility and static import in webapp CLI, so
@RequestMapping("/")
@ResponseBody
String home(Model model) {
template "home.html", model
}
renders the template in /templates/home.html
[Fixes #49832753]
This commit is contained in:
@@ -92,6 +92,13 @@ public class SampleIntegrationTests {
|
||||
assertTrue("Wrong output: " + output, output.contains("Hello World"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void templateSample() throws Exception {
|
||||
start("samples/template.groovy");
|
||||
String output = getOutput();
|
||||
assertTrue("Wrong output: " + output, output.contains("Hello World!"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void jobSample() throws Exception {
|
||||
start("samples/job.groovy", "foo=bar");
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Hello ${message}!
|
||||
Reference in New Issue
Block a user