標籤:jstl view ram group framework debug class depend 返回
1,在項目的設定檔加入以下依賴
<dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency> <!--支援jsp --> <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> <version>1.2</version> </dependency> <!-- 解決訪問頁面404 --> <dependency> <groupId>org.apache.tomcat.embed</groupId> <artifactId>tomcat-embed-jasper</artifactId> <scope>provided</scope> </dependency> <!-- 設定為provided是在打包時會將該包排除,因為要放到獨立的tomcat中運行,是不需要的。 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> <scope>provided</scope> </dependency>
2、propertis檔案配置jsp資源路徑
#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
這樣就可以對jsp支援了,並且解決了頁面訪問返回404的問題
Springboot-添加對jsp支援