Apache Struts团队已发布了最新的Struts 2.3.15.1,修复了上述漏洞,建议采用Struts 2.0至Struts 2.3的网站开发者尽快升级至最新版。 html
最后再次提醒广大网站管理员,尽快将Struts 2升级到最新的2.3.15.1版本。
Struts 2.3.15.1官方下载:http://struts.apache.org/download.cgi#struts23151
java
要升级的jar大体以下: web
xwork-core-2.3.15.1.jar spring
commons-lang3-3.1.jar apache
commons-fileupload-1.3.jar json
commons-lang-2.4.jar 安全
commons-io-2.0.1.jar
服务器
ognl-3.0.6.jar 网站
struts2-core-2.3.15.1.jar this
struts2-json-plugin-2.3.15.1.jar
struts2-junit-plugin-2.3.15.1.jar
struts2-spring-plugin-2.3.15.1.jar
javassist-3.11.0.GA.jar
ognl-3.0.6.jar
更换完jar包后,启动会报错:
在struts2.3.7下,web.xml中使用
… <filter>
<filter-name>struts2</filter-name>
<filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class>
</filter>
会出现
***********************************************************************
* 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..即,从Struts 2.1.3起已被标注为过期的,改用StrutsPrepareAndExecuteFilter
解决方法,将web.xml上述代码改成:
… <filter>
<filter-name>struts2</filter-name>
<filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </filter-class>
</filter>