本想在springboot中使用下jsp,按照开发步骤一步一步写,Pom也添加了依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<!--<scope>compile</scope>-->
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
结果在intellij idea启动之后遇到了jsp及静态资源无法访问的问题
但是将其mvn clean package之后,部署到独立tomcat,是可以的
在项目中直接terminal mvn spring-boot:run也是可以的
Running the application from maven is not very nice solution.
Is there any solution, workaround how to work with Spring Boot WAR application with tomcat starter provided and running it from Idea?
怀疑是intellij idea内嵌的tomcat servlet容器中的问题,google一番找到stackoverflow上一篇文章
https://stackoverflow.com/questions/30237768/run-spring-boots-main-using-ide
也是说provided有问题,intelliJ IDEA不会将scope provided依赖项注入到CLASSPATH中,但实际上将scope设置为compile也不可以,所以还没有找到解决方案