This article mainly introduces the detailed explanation of adding jsp support configuration in Spring boot. The editor thinks it is quite good, so I will share it with you now and give it as a reference. Let’s follow the editor to take a look.
spring boot adds support for jsp. The following is the configuration of the pom.xml file
4.0.0 spring_web_boot spring_web_boot_base war 0.0.1-SNAPSHOT spring_web_boot_base Maven Webapp http://maven.apache.org org.springframework.boot spring-boot-starter-parent 1.4.0.RELEASE org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-data-jpa mysql mysql-connector-java javax.servlet javax.servlet-api javax.servlet jstl org.springframework.boot spring-boot-starter-tomcat provided org.apache.tomcat.embed tomcat-embed-jasper org.springframework.boot spring-boot-maven-plugin spring-snapshots http://repo.spring.io/snapshot true spring-milestones http://repo.spring.io/milestone true spring-snapshots http://repo.spring.io/snapshot spring-milestones http://repo.spring.io/milestone
The above configuration is divided into 2 situations
1. When version 1.4.0 is introduced in the parent tag, the jsp prefix and suffix should be configured as follows in application.properties, and mvc
spring.mvc.view.prefix=/WEB-INF/jsp/ spring.mvc.view.suffix=.jsp
2 must be included. When version 1.1.3 is introduced in the parent tag, then when configuring the jsp prefix and suffix in application.properties, it should be configured as follows. Be sure not to include mvc
spring.view.prefix=/WEB-INF/jsp/ spring.view.suffix=.jsp
org.apache.tomcat.embed tomcat-embed-jasper
For the above configuration in pom.xml, be sure not to add the function for provided
Finally, add the maven path of Alibaba Cloud in maven settings.xml, which can improve downloading Speed
nexus-aliyun * Nexus aliyun http://maven.aliyun.com/nexus/content/groups/public
The above is the detailed content of Detailed introduction to Spring boot adding jsp support configuration examples. For more information, please follow other related articles on the PHP Chinese website!