Home> Java> javaTutorial> body text

Detailed introduction to Spring boot adding jsp support configuration examples

零下一度
Release: 2018-05-29 11:07:40
Original
2028 people have browsed it

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   
Copy after login

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
Copy after login

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
Copy after login

Notes:

 org.apache.tomcat.embed tomcat-embed-jasper 
Copy after login

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 
Copy after login

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!