spring boot(五) 整合JSP
一、jsp整合问题(参考https://blog.csdn.net/news_out/article/details/87863295)
背景:springboot2.0.5整合jsp
依赖如下,在父工程下建造SpringBoot-JSP子工程
<parent> <artifactId>SpringBoot_Parent</artifactId> <groupId>com.qingfeng</groupId> <version>1.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>SpringBoot-JSP</artifactId> <packaging>war</packaging> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!--整合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> </dependencies>
整合之后一直出现如图所示的内容
在确定启动正常,访问路径正常,配置文件配置了视图映射路径后,最终解决方案为:
进入编辑配置选择对应的项目启动项(例为ApplicationContext),选择对应的工作目录,点击apply、ok就行