1、删除以下原先jar包:
删除11个jar
commons-io-1.4.jar
commons-logging-1.0.4.jar
freemarker-2.3.8.jar
javassist-3.4.GA.jar
json-lib-2.1-jdk15-j4.jar
jsonplugin-0.31-j4.jar
ognl-2.6.11.jar
struts2-codebehind-plugin-2.0.9-j4.jar
struts2-core-j4-2.0.9.jar
struts2-spring-plugin-2.0.9-j4.jar
xwork-j4-2.0.4.jar
2、将libs.rar压缩包解压,添加到\WEB-INF\lib,增加11个jar
commons-io-2.2.jar
commons-lang3-3.2.jar
commons-logging-1.1.3.jar
freemarker-2.3.22.jar
javassist-3.11.0.GA.jar
json-lib-2.3-jdk15.jar
ognl-3.0.14.jar
struts2-core-2.3.28.1.jar
struts2-json-plugin-2.3.28.1.jar
struts2-spring-plugin-2.3.28.1.jar
xwork-core-2.3.28.1.jar
3、修改WEB-INF\web.xml配置文件
原内容:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
修改成:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
4、修改struts.xml配置文件
在原内容的基础上<struts>标签里添加<constant name="struts.enable.DynamicMethodInvocation" value="false" />
例如:
原内容:
<struts>
<xxx></xxx>
</struts>
修改后:
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<constant name="struts.action.excludePattern" value="/dwr/.*,/services/.*"/>
<xxx></xxx>
</struts>
5、查询JDK版本
如果启动Tomcat后访问不了,则查询jdk版本。
确保服务器JDK需1.6以上1.7以下。
查询jdk命令:java -version
重新启动Tomcat后测试看看。
删除11个jar
commons-io-1.4.jar
commons-logging-1.0.4.jar
freemarker-2.3.8.jar
javassist-3.4.GA.jar
json-lib-2.1-jdk15-j4.jar
jsonplugin-0.31-j4.jar
ognl-2.6.11.jar
struts2-codebehind-plugin-2.0.9-j4.jar
struts2-core-j4-2.0.9.jar
struts2-spring-plugin-2.0.9-j4.jar
xwork-j4-2.0.4.jar
2、将libs.rar压缩包解压,添加到\WEB-INF\lib,增加11个jar
commons-io-2.2.jar
commons-lang3-3.2.jar
commons-logging-1.1.3.jar
freemarker-2.3.22.jar
javassist-3.11.0.GA.jar
json-lib-2.3-jdk15.jar
ognl-3.0.14.jar
struts2-core-2.3.28.1.jar
struts2-json-plugin-2.3.28.1.jar
struts2-spring-plugin-2.3.28.1.jar
xwork-core-2.3.28.1.jar
3、修改WEB-INF\web.xml配置文件
原内容:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
修改成:
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
4、修改struts.xml配置文件
在原内容的基础上<struts>标签里添加<constant name="struts.enable.DynamicMethodInvocation" value="false" />
例如:
原内容:
<struts>
<xxx></xxx>
</struts>
修改后:
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<constant name="struts.action.excludePattern" value="/dwr/.*,/services/.*"/>
<xxx></xxx>
</struts>
5、查询JDK版本
如果启动Tomcat后访问不了,则查询jdk版本。
确保服务器JDK需1.6以上1.7以下。
查询jdk命令:java -version
重新启动Tomcat后测试看看。