When Spring Boot application running by Intelij Idea views can`t be resolved

為{幸葍}努か 提交于 2020-01-15 03:21:28

问题


I have encountered a strange situation, the decision which I cant find. I`m runnig simple demo application using Spring Boot 1.3.0 and Intelij Idea 14.1.3

The problem is that Spring MVC cant resolve the view:

javax.servlet.ServletException: Could not resolve view with name 'home' in servlet with name 'dispatcherServlet'

Oddity is that when I run application by Maven Spring Boot-plugin

mvn clean spring-boot:run

everythig works fine.

Both views ("home.jsp" - returning from Controller and "start.jsp" - described in Configuration class) resolve correctly.

Full source code you can see here

I`ve downloaded another demo project - the same situation.

So, I think that something wrong with my IDE configuration. But what is going wrong - I don`t know.

In File->Project Structure

I have added Spring and web module in "Modules" tab, the same I`ve made in "Facets" tab.

What is possible to do to make application run correctly using IDE?


回答1:


Problem was in dependecies configuration in pom.xml

<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>

I have change <scope>provided</scope> to <scope>compile</scope> and it works well.



来源:https://stackoverflow.com/questions/34114681/when-spring-boot-application-running-by-intelij-idea-views-cant-be-resolved

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!