首页 > 其他 > 详细

>>> FilterDispatcher <<< is deprecated! Please use the new filters!

时间:2015-12-31 22:46:59      阅读:386      评论:0      收藏:0      [点我收藏+]

在struts2.3.20下,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 StrutsPrepareFilterand StrutsExecuteFilter if needing using the ActionContextCleanUp filter in addition to this one

从>=2.1.3的版本开始,FilterDispatcher被标记为过时,取而代之的是新的

     StrutsPrepareAndExecuteFilter

  所以如果你的struts版本大于2.1.3时,filter配置要变成:

     org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter。


解决方法,将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>/*</url-pattern>
</filter-mapping>

 

>>> FilterDispatcher <<< is deprecated! Please use the new filters!

原文:http://www.cnblogs.com/LicwStack/p/5092719.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!