struts2 The Struts dispatcher cannot be found异常解决办法
来源:互联网 发布:软件开发相关书籍 编辑:程序博客网 时间:2024/06/05 03:37
HTTP Status 500 - The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
一、原因
出现这个原因一般是web.xml文件配置出现问题,
<filter> <filter-name>struts</filter-name> <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class></filter><filter-mapping> <filter-name>struts</filter-name> <url-pattern>*.action</url-pattern></filter-mapping>
这样配置以后,struts2只拦截以.action结尾的请求,而在页面中使用了struts的标签,没有被struts拦截,所以,标签不能被解析,就会报错。
二、解决办法
就是让struts2拦截页面的请求。最简单粗暴的方法就是拦截所有的请求。
<filter> <filter-name>struts</filter-name> <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class></filter><filter-mapping> <filter-name>struts</filter-name> <url-pattern>/*</url-pattern></filter-mapping>
0 0
- struts2 The Struts dispatcher cannot be found异常解决办法
- struts2 异常信息:The Struts dispatcher cannot be found.
- struts2常见标签异常:The Struts dispatcher cannot be found.
- Struts2.0的异常 The Struts dispatcher cannot be found.
- Struts2-The Struts dispatcher cannot be found
- The Struts dispatcher cannot be found. 在页面使用struts2的标签时报的异常
- struts2.0 下The Struts dispatcher cannot be found 解决方法
- struts2错误:The Struts dispatcher cannot be found.
- struts2错误:The Struts dispatcher cannot be found.
- struts2错误:The Struts dispatcher cannot be found.
- struts2错误:The Struts dispatcher cannot be found.
- struts2错误:The Struts dispatcher cannot be found.
- struts2标签 The Struts dispatcher cannot be found
- The Struts dispatcher cannot be found in struts2
- struts2错误:The Struts dispatcher cannot be found.
- Struts2配置错误之The Struts dispatcher cannot be found
- Struts2错误:The Struts dispatcher cannot be found.
- struts2错误:The Struts dispatcher cannot be found
- Java并发的四种风味:Thread、Executor、ForkJoin和Actor
- 映射文件xxx.hbm.xml下的各元素结构
- org.hibernate.id.IdentifierGenerationException
- 【Android】ArrayList通过remove方法删除元素对象源码分析
- ALM各模块的关联
- struts2 The Struts dispatcher cannot be found异常解决办法
- Linux命令——uname
- 愚人节的礼物
- HDOJ 2122 Ice_cream’s world III【Prime】&【Kruskal】
- LightOJ 1248 Dice (III)
- 实现扫描二维码和生成带logo的二维码
- Java 设计模式 概要
- iterator erase
- 在CentOS 6上使用awstats分析httpd和tomcat日志