BUG总结—— No mapping found for HTTP request with URI

No mapping found for HTTP request with URI,

今天遇到一个比较奇怪的问题,spring mvc在页面分发的时候一直找不到页面。

报错是 No mapping found for HTTP request with URI,

经过后来查找原因,是web.xml中对spring-servlet.xml的匹配规则

<url-pattern>的不正确而导致的。

<url-pattern>/*</url-pattern>这是匹配所有请求,而如果这么写,被视图解析器解析后的视图也会再次被响应匹配,导致找不到页面。

改为/即可解决。

猜你喜欢

转载自blog.csdn.net/doujinlong1/article/details/81195975