struts2与struts1融合使用导致的问题,过滤器的路径如何设置?

xtb_0129 xtb_0129 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
各位好:我用的struts2和struts1融合在一起使用的。为了避免struts2对struts1造成影响,我在<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
用到了*.action的方式。但是这样存在一个问题,我提交页面全部用*.action方式到达跳转页面。但是当我点击IE上的后退的时候,就报错了,原因是我没有通过*.action的方式跳转到相应的页面。像我这种情况该怎么解决这个问题呢?

错误信息:

org.apache.jasper.JasperException: 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.
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
com.sitech.ismp.util.context.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:168)
...全文
评论 3
收藏 已收藏
分享
返回顶部
xtb_0129
Web 开发 81,107 成员 341,720 内容