struts2.2.3升级到2.3.15.3过程记录

如下按照步骤,依次介绍。 java

1.jar包替换。共包括一下几个。 web

commons-lang3-3.1.jar
ognl-3.0.6.jar
struts2-convention-plugin-2.3.15.3.jar
struts2-core-2.3.15.3.jar
struts2-json-plugin-2.3.15.3.jar
xwork-core-2.3.15.3.jar
express

2.以后工程内编译报错。主要是新版中的api有变动。 apache

struts中校验的一个属性原名为expression,新版为regexExpression。所有修改。 json

3.还有一个错误老是修改很差。以前的版本中没有Date类型的校验,工程本身实现,继承了xwork的DateRangeFieldValidator。 api

如今编译报错,就只是把错误修正,启动报错。 socket

后来发如今新的xwork中已有相似实现,旧的文件删掉,配置信息删掉。 测试

4.紧接着有报错,主要错误信息有 spa

[webserver][ERROR][2013-10-25 17:18:06][main][c.o.x.u.l.c.CommonsLogger.error(line:38)]:> Actual exception
com.opensymphony.xwork2.config.ConfigurationException: Caught Exception while registering Interceptor class org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor
.net


Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.6.0_20]

搜索良久后才找到缘由,配置文件的文件声明须要修改。修改以后:

struts.xml

<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">


validators.xml

<!DOCTYPE validators PUBLIC
        "-//Apache Struts//XWork Validator Config 1.0//EN"
        "http://struts.apache.org/dtds/xwork-validator-config-1.0.dtd">


5.启动后,控制台提示 >>> ActionContextCleanUp <<< is deprecated! Please use the new filters!

原来是新版中web.xml配置的ActionContextCleanUp不建议使用了,删掉。

至此,主要问题已经解决,程序启动正常。再测试一下。

注:

1.后台有一堆报错信息,正在找方法解决。还好报错不影响程序运行。

相关文章
相关标签/搜索