Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
bfbb720d
Commit
bfbb720d
authored
May 16, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docs for Groovy Templates
parent
2cadf416
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
13 deletions
+42
-13
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+13
-2
howto.adoc
spring-boot-docs/src/main/asciidoc/howto.adoc
+15
-2
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+14
-9
No files found.
spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
bfbb720d
...
@@ -94,10 +94,21 @@ content into your application; rather pick only the properties that you need.
...
@@ -94,10 +94,21 @@ content into your application; rather pick only the properties that you need.
spring.freemarker.exposeSpringMacroHelpers=false
spring.freemarker.exposeSpringMacroHelpers=false
spring.freemarker.prefix=
spring.freemarker.prefix=
spring.freemarker.requestContextAttribute=
spring.freemarker.requestContextAttribute=
spring.freemarker.suffix=
spring.freemarker.suffix=
.ftl
spring.freemarker.templateEncoding=UTF-8
spring.freemarker.templateEncoding=UTF-8
spring.freemarker.templateLoaderPath=classpath:/templates/
spring.freemarker.templateLoaderPath=classpath:/templates/
spring.freemarker.viewNames=
spring.freemarker.viewNames= # whitelist of view names that can be resolved
# GROOVY TEMPLATES ({sc-spring-boot-autoconfigure}}/groovy/template/GroovyTemplateAutoConfiguration.{sc-ext}[GroovyTemplateAutoConfiguration])
spring.groovy.template.allowRequestOverride=false
spring.groovy.template.allowSessionOverride=false
spring.groovy.template.cache=true
spring.groovy.template.contentType=text/html
spring.groovy.template.prefix=classpath:/templates/
spring.groovy.template.suffix=.tpl
spring.groovy.template.templateEncoding=UTF-8
spring.groovy.template.viewNames= # whitelist of view names that can be resolved
spring.groovy.template.configuration.*= # See Groovy's TemplateConfiguration
# INTERNATIONALIZATION ({sc-spring-boot-autoconfigure}/MessageSourceAutoConfiguration.{sc-ext}[MessageSourceAutoConfiguration])
# INTERNATIONALIZATION ({sc-spring-boot-autoconfigure}/MessageSourceAutoConfiguration.{sc-ext}[MessageSourceAutoConfiguration])
spring.messages.basename=messages
spring.messages.basename=messages
...
...
spring-boot-docs/src/main/asciidoc/howto.adoc
View file @
bfbb720d
...
@@ -816,8 +816,16 @@ added.
...
@@ -816,8 +816,16 @@ added.
and `spring.freemarker.suffix`, defaults ``'' and ``.ftl'' respectively). It can be overriden
and `spring.freemarker.suffix`, defaults ``'' and ``.ftl'' respectively). It can be overriden
by providing a bean of the same name.
by providing a bean of the same name.
* If you use Groovy templates (actually if groovy-templates is on your classpath) you
also have a `Groovy TemplateViewResolver` with id
``groovyTemplateViewResolver''. It looks for resources in a loader path by
surrounding the view name with a prefix and suffix (externalized to `spring.groovy.template.prefix`
and `spring.groovy.template.suffix`, defaults ``classpath:/templates/'' and ``.tpl'' respectively). It can be overriden
by providing a bean of the same name.
Check out {sc-spring-boot-autoconfigure}/web/WebMvcAutoConfiguration.{sc-ext}[`WebMvcAutoConfiguration`],
Check out {sc-spring-boot-autoconfigure}/web/WebMvcAutoConfiguration.{sc-ext}[`WebMvcAutoConfiguration`],
{sc-spring-boot-autoconfigure}/thymeleaf/ThymeleafAutoConfiguration.{sc-ext}[`ThymeleafAutoConfiguration`], and
{sc-spring-boot-autoconfigure}/thymeleaf/ThymeleafAutoConfiguration.{sc-ext}[`ThymeleafAutoConfiguration`],
{sc-spring-boot-autoconfigure}/groovy/template/GroovyTemplateAutoConfiguration.{sc-ext}['GroovyTemplateAutoConfiguration'] and
{sc-spring-boot-autoconfigure}/freemarker/FreeMarkerAutoConfiguration.{sc-ext}['FreeMarkerAutoConfiguration']
{sc-spring-boot-autoconfigure}/freemarker/FreeMarkerAutoConfiguration.{sc-ext}['FreeMarkerAutoConfiguration']
...
@@ -1381,7 +1389,6 @@ If you are using Thymeleaf, then set `spring.thymeleaf.cache` to `false`. See
...
@@ -1381,7 +1389,6 @@ If you are using Thymeleaf, then set `spring.thymeleaf.cache` to `false`. See
for other Thymeleaf customization options.
for other Thymeleaf customization options.
[[howto-reload-freemarker-content]]
[[howto-reload-freemarker-content]]
=== Reload FreeMarker templates without restarting the container
=== Reload FreeMarker templates without restarting the container
If you are using FreeMarker, then set `spring.freemarker.cache` to `false`. See
If you are using FreeMarker, then set `spring.freemarker.cache` to `false`. See
...
@@ -1389,6 +1396,12 @@ If you are using FreeMarker, then set `spring.freemarker.cache` to `false`. See
...
@@ -1389,6 +1396,12 @@ If you are using FreeMarker, then set `spring.freemarker.cache` to `false`. See
for other FreeMarker customization options.
for other FreeMarker customization options.
[[howto-reload-groovy-template-content]]
=== Reload Groovy templates without restarting the container
If you are using Groovy templates, then set `spring.groovy.template.cache` to `false`. See
{sc-spring-boot-autoconfigure}/groovy/template/GroovyTemplateAutoConfiguration.{sc-ext}[`GroovyTemplateAutoConfiguration`]
for other Groovy customization options.
[[howto-reload-java-classes-without-restarting]]
[[howto-reload-java-classes-without-restarting]]
=== Reload Java classes without restarting the container
=== Reload Java classes without restarting the container
...
...
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
bfbb720d
...
@@ -905,15 +905,20 @@ and it will be silently ignored by most build tools if you generate a jar.
...
@@ -905,15 +905,20 @@ and it will be silently ignored by most build tools if you generate a jar.
[[boot-features-spring-mvc-template-engines]]
[[boot-features-spring-mvc-template-engines]]
==== Template engines
==== Template engines
As well as REST web services, you can also use Spring MVC to serve dynamic HTML content.
Spring MVC supports a variety of templating technologies including: Velocity, FreeMarker,
As well as REST web services, you can also use Spring MVC to serve
and JSPs. Many other templating engines also ship their own Spring MVC integrations.
dynamic HTML content. Spring MVC supports a variety of templating
technologies including: Velocity, FreeMarker and JSPs. Many
Spring Boot includes auto-configuration support for the Thymeleaf and FreeMarker
other templating engines also ship their own Spring MVC integrations.
templating engines. Thymeleaf is an XML/XHTML/HTML5 template engine that can work both in
web and non-web environments. If allows you to create natural templates that can be
Spring Boot includes auto-configuration support for the Thymeleaf,
correctly displayed by browsers and therefore work also as static prototypes. Both
[FreeMarker](http://freemarker.org/docs/) and
FreeMarker and Thymeleaf templates will be picked up automatically from
[Groovy](http://beta.groovy-lang.org/docs/groovy-2.3.0/html/documentation/markup-template-engine.html)
templating engines. Thymeleaf is an XML/XHTML/HTML5 template engine
that can work both in web and non-web environments. If allows you to
create natural templates that can be correctly displayed by browsers
and therefore work also as static prototypes. Your FreeMarker, Groovy
and Thymeleaf templates will be picked up automatically from
`src/main/resources/templates`.
`src/main/resources/templates`.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment