1Add maven dependency
<!-- tomcat , support for jsp --><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId></dependency><dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId></dependency><dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId></dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId></dependency>
2View pom.xml
spring-boot-starter-parent
If the version is a version larger than 1.4 application.properties added
# The default prefix directory of page spring.mvc.view.prefix:/static/jsp/# The default suffix of response page spring.mvc.view.suffix:.jsp
Note: The dependency of the official template thymeleaf and the dependency of the jsp in the pom file cannot coexist.
Attached:
Add JSP file in IDEA
Summarize
The above is the SpringBoot addition JSP support and attaches it to you. Create a JSP file under IDEA [test correct]. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support to Wulin.com website!