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>