springmvc--无法找到视图PageNotFound.noHandlerFound No mapping found for HTTP request
2017-08-27 15:12
302 查看
在搭建SSM框架的过程中,我首先搭建SpringMVC框架,如何搭建,此处略。刚开始没有问题,springMVC搭建成功,运行、测试也没有问题,之后在集成mybatis和Spring的时候,可能不小心改了web.xml中的配置,报404。搞了好久,最后偶然发现一篇文档:https://stackoverflow.com/questions/41577234/why-does-spring-mvc-respond-with-a-404-and-report-no-mapping-found-for-http-req
里面解决方法是将web.xml文件中的配置
改成
原因,大概意思就是因为 /* 斜杠+星号表示匹配所有请求路径,优先级比 / 斜杆 要高,而InternalResourceViewResolver的处理方式见这位老兄的文章:http://blog.csdn.net/zmx729618/article/details/51554762,因此,会出现一些问题:
No mapping found for HTTP request with URI
name 'dispatcher'
Because the
mapped to
everything (except exact matches, which have higher priority), the
be chosen to handle the
the
by the
almost every case, the
not be configured to handle such a request.
Instead, in this simplistic case, you should register the
marking it as the default servlet. The default servlet is the last match for a request. This will allow your typical servlet container to chose an internal Servlet implementation, mapped to
to handle the JSP resource (for example, Tomcat has
before trying with the default servlet.
翻译不清楚,留用。
里面解决方法是将web.xml文件中的配置
改成
原因,大概意思就是因为 /* 斜杠+星号表示匹配所有请求路径,优先级比 / 斜杆 要高,而InternalResourceViewResolver的处理方式见这位老兄的文章:http://blog.csdn.net/zmx729618/article/details/51554762,因此,会出现一些问题:
No mapping found for HTTP request with URI
[/Example/WEB-INF/jsps/example-view-name.jsp]in
DispatcherServletwith
name 'dispatcher'
Because the
DispatcherServletis
mapped to
/*and
/*matches
everything (except exact matches, which have higher priority), the
DispatcherServletwould
be chosen to handle the
forwardfrom
the
JstlView(returned
by the
InternalResourceViewResolver). In
almost every case, the
DispatcherServletwill
not be configured to handle such a request.
Instead, in this simplistic case, you should register the
DispatcherServletto
/,
marking it as the default servlet. The default servlet is the last match for a request. This will allow your typical servlet container to chose an internal Servlet implementation, mapped to
*.jsp,
to handle the JSP resource (for example, Tomcat has
JspServlet),
before trying with the default servlet.
翻译不清楚,留用。
相关文章推荐
- 完美解决SpringMVC中静态资源无法找到(No mapping found for HTTP request with URI)问题
- Spring MVC PageNotFound.noHandlerFound No mapping found for HTTP request with URI
- org.springframework.web.servlet.PageNotFound noHandlerFound 警告: No mapping found for HTTP request w
- SpringMVC资源无法找到(No mapping found for HTTP request with URI)问题解决
- SpringMVC中静态资源无法找到(No mapping found for HTTP request with URI)的四种解决方式
- Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决
- 静态资源无法找到(No mapping found for HTTP request with URI)问题
- Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决
- Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决
- Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决
- org.springframework.web.servlet.PageNotFound]-[WARN] No mapping found for HTTP request with URI [/re
- Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决
- Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决
- WARN PageNotFound:1120 - No mapping found for HTTP request with URI [/favicon.ico] in DispatcherServ
- Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决
- 【Spring】Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决
- Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决
- [org.springframework.web.servlet.PageNotFound] - No mapping found for HTTP request with URI [/ssm/us
- Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决(转)
- Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决--转载