测试环境在之间本来是没有问题的,今天突然要做些测试于是启动项目,就出现如下的问题,发现很多请求都报pagenotfound 的错误,根据提示js和gif的文件其实都是在的,项目启动是正常的。请高人指点下 小弟不甚感激!!!
2012-09-27 18:22:43,797 WARN [org.springframework.web.servlet.PageNotFound] -No mapping found for HTTP request with URI [/biz/js/jquery-1.5.1.min.js] in DispatcherServlet with name 'hisun'
2012-09-27 18:22:43,828 WARN [org.springframework.web.servlet.PageNotFound] -No mapping found for HTTP request with URI [/biz/images/login-top-bg.gif] in DispatcherServlet with name 'hisun'
2012-09-27 18:22:43,845 WARN [org.springframework.web.servlet.PageNotFound] -No mapping found for HTTP request with URI [/biz/images/login-wel.gif] in DispatcherServlet with name 'hisun'
2012-09-27 18:22:43,860 WARN [org.springframework.web.servlet.PageNotFound] -No mapping found for HTTP request with URI [/biz/images/login_bg.jpg] in DispatcherServlet with name 'hisun'
2012-09-27 18:22:43,873 WARN [org.springframework.web.servlet.PageNotFound] -No mapping found for HTTP request with URI [/biz/images/btn-bg2.gif] in DispatcherServlet with name 'hisun'
2012-09-27 18:22:43,894 WARN [org.springframework.web.servlet.PageNotFound] -No mapping found for HTTP request with URI [/biz/images/login-content-bg.gif] in DispatcherServlet with name 'hisun'
2012-09-27 18:22:43,908 WARN [org.springframework.web.servlet.PageNotFound] -No mapping found for HTTP request with URI [/biz/images/logo2.png] in DispatcherServlet with name 'hisun'
正常,因为你在web.xml里配置了dispatcherservlet的url是/或者/*。导致页面上所有对图片的请求也会被路由进spring mvc。在你的配置文件里配置一下静态资源就好了。
<mvc:resources mapping="/css/**" location="/css/" /><mvc:resources mapping="/images/**" location="/images/" /><mvc:resources mapping="/js/**" location="/js/" />
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。