The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the...
来源:互联网 发布:帝国cms播放器插件 编辑:程序博客网 时间:2024/05/20 06:30
异常信息: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.
问题描述:在jsp页面中使用struts2.0标签,访问jsp页面时会出现异常.
web.xml部分配置文件:
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
问题原因:
如果想要在jsp文件中,采用 struts的tag,那么jsp必须是通过action跳转得到,也就是必须通过web.xml所配置的过滤器访问文件,否则会有异常。
解决办法:
方案一:将web.xml 的过滤器,从 *.action 修改为: /* 。
方案二:web.xml 中再添加一个filter
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the...
- Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associat
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the assoc
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the assoc
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the asso
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the assoc
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the asso
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the asso
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the assoc
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the...的异常
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the assoc
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the asso
- jsp报The Struts dispatcher cannot be found. This is usually caused by using Struts tags without
- he Struts dispatcher cannot be found. This is usually caused by using Struts tags without the assoc
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags a
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags a
- Struts2标签问题-The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. S
- struts2 标签使用异常 The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filte
- Hat's Fibonacci
- 关于C++(VC2005)编译多一条JMP指令的问题,待解决
- 黑马程序员--java集合(一)
- C++ C++和java中的运算区别
- STL中用erase()方法遍历删除元素
- The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the...
- 判断一个单向链表中是否有环
- cocoapods的缺点
- 有2个数组A,B, B数组中的元素包含在A数组中,请写一段代码把A数组中B没有的元素放道C数组中。
- ORACLE和SQL语法区别归纳
- 调用 fork() 两次以避免僵死进程
- 从事文字工作和经常使用电脑的人要注意保护好自己的眼睛
- GCC编译过程分解
- 使用Eclipse+MyEclipse开发中的编码设置