1, add the following dependencies in the project's configuration file
<dependency> <groupId>javax.servlet</groupId> <artifactid>javax.servlet-api& Lt;/artifactid> <scope>provided</scope> </dependency> <!--support JSP -<dependency> <groupId>javax.servlet</groupId> <artifactId> Jstl</artifactid> <version>1.2</version> </dependency> <!--Resolution access page 404--<dependency> <group Id>org.apache.tomcat.embed</groupid> <artifactId>tomcat-embed-jasper</artifactId> <scope>provided</scope> </dependency> <!--set to provided will exclude the package when it is packaged, as it is to be run in a standalone Tomcat, is not needed. -<dependency> <groupId>org.springframework.boot</groupId> <ARTIFAC Tid>spring-boot-starter-tomcat</artifactid> <scope>provided</scope> </dependency >
2. propertis file Configuration JSP resource path
#server. port=8089server.servlet-path=/#配置静态资源spring. Resources . static-locations=classpath:/public/#logging. level.org.springframework= DEBUGspring.mvc.view.prefix=/web-inf/views/spring.mvc.view.suffix=.jsp
This allows for JSP support, and resolves the issue of page access return 404
springboot-adding support for JSP