Spring Boot Basic Tutorial 8-web application Development-template engine JSP

Source: Internet
Author: User
Tags deprecated



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:


  1.  contains the contentnegotiatingviewresolver and beannameviewresolver beans.
  2.  support for static resources, including support for Webjars.
  3.  Auto-register converter,genericconverter,formatter beans.
  4. support for the httpmessageconverters.
  5.  Automatic registration of Messagecoderesolver.
  6.  support for static index.html.
  7.  support for Custom favicon.
  8.  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:


  1. JSP can only be packaged as: War format, does not support jar format, can only run in standard containers (Tomcat,jetty can)
  2.  The embedded jetty currently does not support JSPs
  3.  Undertow JSPs not supported
  4.  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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.