A. Spring boot 's Web application development is based on spring MVC
two. Spring Boot is based on spring default, and the following features are added for automatic configuration:
- contains the contentnegotiatingviewresolver and beannameviewresolver beans.
- support for static resources, including support for Webjars.
- Auto-register converter,genericconverter,formatter beans.
- support for the httpmessageconverters.
- Automatic registration of Messagecoderesolver.
- support for static index.html.
- support for Custom favicon.
- active use of configurablewebbindinginitializer beans
three. selection of template engine
Freemarker
Thymeleaf
Velocity ( deprecated after version 1.4, deprecated after Spring Framework version 4.3)
Groovy
Mustache
Note: JSP should be avoided as much as possible for the following reasons:
- JSP can only be packaged as: War format, does not support jar format, can only run in standard containers (Tomcat,jetty can)
- The embedded jetty currently does not support JSPs
- Undertow JSPs not supported
- JSP The custom error page cannot overwrite the spring boot default error page
Four. Jsp Demo
to Add configuration parameters:
Spring.mvc.view.prefix:/web-inf/templates/
Spring.mvc.view.suffix:. jsp
Follow the public number:
This article is from the "11642765" blog, please be sure to keep this source http://11652765.blog.51cto.com/11642765/1867704
Spring Boot Basic Tutorial 8-web application Development-template engine JSP