struts2升级至2.5.30笔记
1、项目中使用了xwork-core-2.3.32,需要去掉,因为struts2的2.5以上版本已经将xwork合并;
2、其余替换的jar包
3、struts.xml,头部 修改为struts-2.5.dtd
3.1增加<constant name="struts.enable.DynamicMethodInvocation" value="true"/>
<constant name="struts.enable.SlasheInActionNames" value="true"/>
3.2每一个package配置后需要增加 strict-method-invocation="false"
例如:<package name="ebidding-frame" extends="struts-default" strict-method-invocation="false"></package>
4、这时提示项目可以启动,但是页面打开报错,提示找不到com.opensymphony.xwork2.util.LocalizedTextUtil
在 struts.xml中增加以下配置,
<constant name="struts.xworkTextProvider.DefaultTextProvider" value="DefaultTextProvider"/>
将xwork-core-2.3.37.jar包中com/opensymphony/xwork2/util目录下的LocalizedTextUtil文件放进struts2-core-2.5.30.jar的同目录下