当前位置: 代码迷 >> Java Web开发 >> Struts2中页面点击后退报错的有关问题,小弟我将url-pattern从/*改成了*action
  详细解决方案

Struts2中页面点击后退报错的有关问题,小弟我将url-pattern从/*改成了*action

热度:229   发布时间:2016-04-17 10:46:38.0
Struts2中页面点击后退报错的问题,我将url-pattern从/*改成了*.action
各位好:请教个问题,我用struts2,其中的<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 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]错误,是怎么回事呢??该如何设置呢?我把*.action改成 *,就没问题了

------解决方案--------------------
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
你没加这个吧?
------解决方案--------------------
如果是a标签你就必修加*。action
如果是Struts 2.0 标签就不用加了
------解决方案--------------------
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class> 加上分配器
  相关解决方案