Add Spring View support for Groovy Markup Templates
This commit adds support for Groovy Markup templates. Spring's support requires Groovy 2.3.1+. To use it, simply create a GroovyMarkupConfigurer and a GroovyMarkupViewResolver beans in the web application context. Issue: SPR-11789
This commit is contained in:
committed by
Rossen Stoyanchev
parent
6b6b008c1f
commit
0ecfa8e404
@@ -0,0 +1,3 @@
|
||||
layout 'layout-main.tpl',
|
||||
title: 'Layout example',
|
||||
bodyContents: contents { p('This is the body') }
|
||||
@@ -0,0 +1 @@
|
||||
p('Hello Spring')
|
||||
@@ -0,0 +1,2 @@
|
||||
include template: 'includes/include.tpl'
|
||||
p('Hallo Spring')
|
||||
@@ -0,0 +1,2 @@
|
||||
include template: 'includes/include.tpl'
|
||||
p('¡hola Spring')
|
||||
@@ -0,0 +1 @@
|
||||
p('Bonjour Spring')
|
||||
@@ -0,0 +1 @@
|
||||
p('Include Default')
|
||||
@@ -0,0 +1 @@
|
||||
p('Include German')
|
||||
@@ -0,0 +1,8 @@
|
||||
html {
|
||||
head {
|
||||
title(title)
|
||||
}
|
||||
body {
|
||||
bodyContents()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
yieldUnescaped '<!DOCTYPE html>'
|
||||
html {
|
||||
head {
|
||||
meta('http-equiv':'"Content-Type", content="text/html; charset=utf-8"')
|
||||
title('Spring Framework Groovy Template Support')
|
||||
}
|
||||
body {
|
||||
div(class:'test') {
|
||||
h1("Hello $name")
|
||||
p("Groovy Templates")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user