No mapping found for HTTP request with URI [/myproject/] in DispatcherServlet with name 'appServlet' [duplicate]

牧云@^-^@ 提交于 2019-12-05 09:07:18

Spring's convention is to assume that the <servlet-name> in the web.xml for the DispatcherServlet matches the beginning of the Spring servlet context XML file. Rename servlet-context.xml to appServlet-context.xml and see if that helps.

Everything under WEB-INF is not accessible from the outside, and the point of an MVC framework is to invoke a controller before dispatching to the view, so invoking the JSP directly should not be done anyway.

And you probably don't have any Spring controller mapped to the root URL, so obviously, there is nothing at the URL http://localhost:8080/myproject/.

Alonso Dominguez

Add a Controller to your application that returns a ModelAndView instance with name "home". Then configure some handler mapping to that Controller and try to access your web app with a URL similar to this one: http://localhost:8080/myproject/home.do. More information can be found here and here.

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