No mapping found for HTTP request with URI [/zjic] in DispatcherServlet
来源:互联网 发布:阿里云 域名交易 编辑:程序博客网 时间:2024/06/15 23:18
最近做项目 出现了前台访问出现404
控制台出现 No mapping found for HTTP request with URI [/zjic] in DispatcherServlet
web.xml如下
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> <display-name>zjic</display-name> <servlet> <servlet-name>zjic</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>zjic</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> <context-param><param-name>contextConfigLocation</param-name><param-value>/WEB-INF/zjic-servlet.xml</param-value></context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <!-- Session超时 --><session-config> <session-timeout>-1</session-timeout></session-config></web-app>
最终找到原因 把
<servlet-mapping> <servlet-name>zjic</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping>
改为
<servlet-mapping> <servlet-name>zjic</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
即/* 去掉* 可以访问jsp
但是发现无法访问静态资源 很郁闷
一月 25, 2016 12:57:41 上午 org.springframework.web.servlet.DispatcherServlet noHandlerFound
警告: No mapping found for HTTP request with URI [/Extjs5SSM/lib/js/app/app.js] in DispatcherServlet with name 'extjs'
一月 25, 2016 12:57:41 上午 org.springframework.web.servlet.DispatcherServlet noHandlerFound
警告: No mapping found for HTTP request with URI [/Extjs5SSM/lib/js/ext-5.1.0/ext-all.js] in DispatcherServlet with name 'extjs'
等等
参考 http://blog.163.com/zhangmihuo_2007/blog/static/27011075201453044959574?suggestedreading
解决了这个问题:
静态资源都在lib下面
因此在spring配置文件中加入
<!-- 静态资源访问 --><mvc:resources location="/lib/" mapping="/lib/**"/>
如果有多个 可以写多个mvc:resources
解决了这个问题
此时.do 访问可能出现404
参考http://blog.csdn.net/w605283073/article/details/50583978
- No mapping found for HTTP request with URI [/zjic] in DispatcherServlet
- No mapping found for HTTP request with URI [/login.do] in DispatcherServlet with name 'spring'
- No mapping found for HTTP request with URI [/cwgl/department/index] in DispatcherServlet with name
- No mapping found for HTTP request with URI[路径] in DispatcherServlet with name spring3
- 警告: No mapping found for HTTP request with URI [/Springmvc/test] in DispatcherServlet with dispatche
- No mapping found for HTTP request with URI [/...] in DispatcherServlet with name ...的解决方法
- No mapping found for HTTP request with URI [/index.html] in DispatcherServlet with name 'springmvc'
- No mapping found for HTTP request with URI [/springmvc/queryitems.action] in DispatcherServlet with
- 警告: No mapping found for HTTP request with URI [] in DispatcherServlet with name
- Spring : No mapping found for HTTP request with URI in DispatcherServlet with name "..."
- No mapping found for HTTP request with URI [/chart/get] in DispatcherServlet with name 'SpringMVC‘
- No mapping found for HTTP request with URI [/prjName/contro] in DispatcherServlet with name 'spring'
- No mapping found for HTTP request with URI [/index.do] in DispatcherServlet with name 'SpringMVC‘
- No mapping found for HTTP request with URI in DispatcherServlet with name 'XXX'
- No mapping found for HTTP request with URI [...] in DispatcherServlet with name '...'
- No mapping found for HTTP request with URI [/bdp/] in DispatcherServlet with name
- No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'projectname'
- SpringMVC:No mapping found for HTTP request with URI [/account/*] in DispatcherServlet with
- Android http proxy server 设置
- 2013年第四届蓝桥杯C/C++程序设计本科B组省赛 三部排序(代码填空)
- sqlserver学习笔记
- Python IDE
- 正则表达式学习笔记002--星号的应用
- No mapping found for HTTP request with URI [/zjic] in DispatcherServlet
- 纯CSS实现的表格滚动条效果
- Qicklua 定时器
- 图像视觉领域新文章及相应开源代码
- Java 和 C++ return 对象、数组的区别
- 正则表达式学习笔记003--问号和加号的认识与应用
- boot.img的解包、root、打包
- 2014——迈出从5K到1W+的重要一步——掌握设计模式
- 正则表达式学习笔记004--连字符和范围描述符的认识与应用