在struts2.3.7下,web.xml中使用
会出现
***********************************************************************
* WARNING!!! *
* *
* >>> FilterDispatcher <<< is deprecated! Please use the new filters! *
* *
* This can be a source of unpredictable problems! *
* *
* Please refer to the docs for more details! *
* http://struts.apache.org/2.x/docs/webxml.html *
* *
***********************************************************************
原因在于:
Class FilterDispatcher
Deprecated. Since Struts 2.1.3, use StrutsPrepareAndExecuteFilter
instead or StrutsPrepareFilter
and StrutsExecuteFilter
if needing using the ActionContextCleanUp
filter in addition to this one
解决方法,将web.xml上述代码改为:
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
<init-param>
<param-name>struts.action.extendion</param-name>
<param-value>action</param-value>
</init-param>
</filter>
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步