因低版本Struts2存在漏洞,更新为较新的版本。启动时,报如下警告信息:

***************************************************************************
* WARNING!!! *
* *
* >>> ActionContextCleanUp <<< 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 *
* *
***************************************************************************

自2.1.3版本开始,ActionContextCleanUpFilterDispatcher都由StrutsPrepareAndExecuteFilter代替,配置如下:

注释掉

    <filter>
<filter-name>struts2CleanupFilter</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2CleanupFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>

<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>*.nt</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>

改为:

    <filter>
<filter-name>struts2Filter</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2Filter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>

另外,如果要使用sitemesh,要按照strutsPrepareFilter -> sitemesh -> strutsExecuteFilter的顺序配置过滤器,将sitemesh配置在中间,如下:

<filter>
<filter-name>strutsPrepareFilter</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
</filter>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter>
<filter-name>strutsExecuteFilter</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>strutsPrepareFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>strutsExecuteFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

Struts2版本更新报错:>>> ActionContextCleanUp <<< is deprecated! Please use the new filters!的更多相关文章

  1. hexo 报错 use_date_for_updated is deprecated...

    hexo 报错 use_date_for_updated is deprecated... WARN Deprecated config detected: "use_date_for_up ...

  2. struts2启动报错com/opensymphony/xwork2/spring/SpringObjectFactory.java:220:-1

    好久没有搞struts2,今天配置strut2.2.1,启动时遇到个小问题.记录下. tomcat启动报错: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ...

  3. 用Struts2框架报错:The Struts dispatcher cannot be found

    报错信息 The Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the ...

  4. python 报错 wxPyDeprecationWarning: Using deprecated class PySimpleApp.

    如题:python 报错 提示为 : wxPyDeprecationWarning: Using deprecated class PySimpleApp. 解决:将 wx.PySimpleApp() ...

  5. pandas 使用panel 报错 Panel is deprecated and will be removed in a future version.

    Panel is deprecated and will be removed in a future version.The recommended way to represent these t ...

  6. struts2+websocket报错:failed: Error during WebSocket handshake: Unexpected response code:404

    最近把websocket集成进项目里面来,打开网页总是会遇到这样的错误. 网上说的原因有3种,但是都不适合我,但是也记录下. 1.struts2截拦掉了ws的请求.这种援用可以尝试把web.xml清空 ...

  7. struts2启动报错:ERROR com.opensymphony.xwork2.conversion.impl.DefaultConversionPropertiesProcessor - Conversion registration error

    [framework] 2019-12-05 11:34:05,441 - org.springframework.web.context.ContextLoader -5352 [RMI TCP C ...

  8. php报错日志:PHP Deprecated:Automatically populating $HTTP_RAW_POST_DATA is deprecated

    前几天将线上php服务升级到5.6.x版本后,php-error.log报出错误:PHP Deprecated: Automatically populating $HTTP_RAW_POST_DAT ...

  9. struts2 ,web.xml中配置为/*.action,运行报错Invalid <url-pattern> /*.action in filter mapp

    首先,修改成: <filter-mapping>  <filter-name>struts2</filter-name>  <url-pattern>/ ...

随机推荐

  1. P4语法(3)Table,Action

    Table table是p4的匹配——动作表,定义了匹配字段(key).动作(action)和一些其他相关属性. 其处理数据包的流程: Key construction.建立其匹配字段 Key loo ...

  2. Eclipse项目导入到Android Studio中

    背景 最近需要将Eclipse中的android项目导入到Android Studio中!倒腾一番,记录如下! 步骤1 打开Android Studio(下文称AS),选择Import project ...

  3. lintcode-402-连续子数组求和

    [402-连续子数组求和(http://www.lintcode.com/zh-cn/problem/continuous-subarray-sum/) 给定一个整数数组,请找出一个连续子数组,使得该 ...

  4. DB2 日志

    跟Oracle类似DB2也分为两个模式,日志循环vs归档日志,也就是非归档和归档模式,下面对这两种模式做简单的介绍. 日志循环 日志循环是默认方式,也就是非归档模式,这种模式只支持backup off ...

  5. CodeForces Round #527 (Div3) C. Prefixes and Suffixes

    http://codeforces.com/contest/1092/problem/C Ivan wants to play a game with you. He picked some stri ...

  6. CKeditor、CKFinder的安装配置

    CKEditor是不集成文件上传与管理功能的,文件上传管理功能被集成在CKFinder中,这是一个收费的商业软件. 如需要文件上传与管理功能建议使用FCKeditor或者手动破解CKFinder. 下 ...

  7. LoadRunner脚本参数化常见错误

    错误代码:Error:missing newline in d:\loadrunner\username.dat 错误原因:场景设置不合理,参数数量不够,或者参数化文件有问题. 1)如果参数化文件反复 ...

  8. BZOJ 2957 楼房重建(线段树区间合并)

    一个显而易见的结论是,这种数字的值是单调递增的.我们修改一个数只会对这个数后面的数造成影响.考虑线段树划分出来的若干线段. 这里有两种情况: 1.某个线段中的最大值小于等于修改的数,那么这个线段的贡献 ...

  9. Codeforces 627D Preorder Test(二分+树形DP)

    题意:给出一棵无根树,每个节点有一个权值,现在要让dfs序的前k个结点的最小值最大,求出这个值. 考虑二分答案,把>=答案的点标记为1,<答案的点标记为0,现在的任务时使得dfs序的前k个 ...

  10. 关于slow http attack以及apche tomcat的应对方式

    HTTP 的 Slow Attack 有着悠久历史的 HTTP DOS 攻击方式,最早大约追溯到 5 年前,按理说早该修复了,但是 Apache 的默认配置中仍然没有添加相关配置,或者他们认为这是 f ...