Why Template “Spring MVC Project” in “SpringSource Tool Suite” not work with Tomcat?

后端 未结 4 2036
陌清茗
陌清茗 2021-01-03 07:25

When Im create Spring MVC Template project in SpringSource Tool and try to Run on the Tomcat server I have this error:

WARN : org.springframework.web.servlet         


        
4条回答
  •  梦毁少年i
    2021-01-03 08:11

    I was getting the exact same issue and I solved it. Basically, when the Spring MVC Project gets created, Eclipse does not configure src/main/webapp as a source directory by default. It likely needs to be a source directory because then Eclipse will treat the files differently when it builds it.

    Right clicking on the 'webapp' folder and clicking 'Build Path -> Use as Source Folder' solved this issue for me. The other comments here are wrong: I did NOT have to change my RequestMapping or servlet url-pattern. '/' for both worked for my 'localhost:8080/test/'.

提交回复
热议问题