struts2升级到Struts 2.3.15.1的步骤(最新安全版本)
),重新配置tomcat并运行……
?
如果遇到一些NoSuchMethod或者NotClassFound等等的提示,检查一下是不是误删了原来的某个jar;
?
如果看到如此提示:
?
***********************************************************************?
*?????????????????????????????? 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??????????? *?
*???????????????????????????????????????????????????????????????????? *?
***********************************************************************
?
在web.xml里把FilterDispatcher?替换成StrutsPrepareAndExecuteFilter(org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter)
?
?
如果看到如此提示:
?
***********************************************************************?
*?????????????????????????????? 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??????????? *?
*???????????????????????????????????????????????????????????????????? *?
***********************************************************************
?
同样是在web.xml里把ActionContextCleanUp替换成StrutsPrepareAndExecuteFilter(org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter)
?
? ? ? ?若原来就配置有StrutsPrepareAndExecuteFilter,则把ActionContextCleanUp去掉。
? ? ? ?
? ? ? ?比如我这里修改后的样子:
? ?
<!-- STRUTS配置 --> <!-- <filter> 升级到2.3.15.1后要去掉<filter-name>struts2-cleanup</filter-name><filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class></filter><filter-mapping><filter-name>struts2-cleanup</filter-name><url-pattern>/*</url-pattern></filter-mapping> --> <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>*.action</url-pattern><dispatcher>REQUEST</dispatcher><dispatcher>FORWARD</dispatcher></filter-mapping>
?
?
关于升级后的web.xml配置请参考:
http://struts.apache.org/development/2.x/docs/webxml.html
?
?
?
?
? ? ??