删除jar:
asm.jar
asm-attrs.jar
cglib-2.1.3.jar
ognl-2.6.11.jar
xwork-2.1.2.jar
struts2-core-2.1.6.jar
struts2-dojo-plugin-2.1.6.jar
struts2-spring-plugin-2.1.6.jar
struts2-tiles-plugin-2.1.6.jar
添加jar:
asm-3.3.jar
asm-commons-3.3.jar
asm-tree-3.3.jar
cglib-2.2.jar
commons-lang3-3.1.jar
javassist-3.11.0.GA.jar
ognl-3.0.6.jar
xwork-core-2.3.15.1.jar
struts2-config-browser-plugin-2.3.15.1.jar
struts2-convention-plugin-2.3.15.1.jar
struts2-core-2.3.15.1.jar
struts2-dojo-plugin-2.3.15.1.jar
struts2-sitemesh-plugin-2.3.15.1.jar
struts2-spring-plugin-2.3.15.1.jar
struts2-tiles-plugin-2.3.15.1.jar
web.xml里的
<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
修改为
<filter>
<filter-name>StrutsPrepareFilter</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
</filter>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
把所有struts.xml文件的头标题
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
改为
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
报错:
Developer Notification (set struts.devMode to false to disable this message): Unexpected Exception caught setting 'cpage' on 'class com.hx.system.action.ManagerUserAction: Error setting expression 'cpage' with value ['2', ]
Developer Notification (set struts.devMode to false to disable this message): Unexpected Exception caught setting 'maxrow' on 'class com.hx.system.action.ManagerUserAction: Error setting expression 'maxrow' with value ['10', ]
设置struts.devMode=false,就没这种提示了.struts2.3.15.1校验严格了,开发模式下任何参数有提交但是没有对应set方法的时候都会有提示.
asm.jar
asm-attrs.jar
cglib-2.1.3.jar
ognl-2.6.11.jar
xwork-2.1.2.jar
struts2-core-2.1.6.jar
struts2-dojo-plugin-2.1.6.jar
struts2-spring-plugin-2.1.6.jar
struts2-tiles-plugin-2.1.6.jar
添加jar:
asm-3.3.jar
asm-commons-3.3.jar
asm-tree-3.3.jar
cglib-2.2.jar
commons-lang3-3.1.jar
javassist-3.11.0.GA.jar
ognl-3.0.6.jar
xwork-core-2.3.15.1.jar
struts2-config-browser-plugin-2.3.15.1.jar
struts2-convention-plugin-2.3.15.1.jar
struts2-core-2.3.15.1.jar
struts2-dojo-plugin-2.3.15.1.jar
struts2-sitemesh-plugin-2.3.15.1.jar
struts2-spring-plugin-2.3.15.1.jar
struts2-tiles-plugin-2.3.15.1.jar
web.xml里的
<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
修改为
<filter>
<filter-name>StrutsPrepareFilter</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
</filter>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
把所有struts.xml文件的头标题
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
改为
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
报错:
Developer Notification (set struts.devMode to false to disable this message): Unexpected Exception caught setting 'cpage' on 'class com.hx.system.action.ManagerUserAction: Error setting expression 'cpage' with value ['2', ]
Developer Notification (set struts.devMode to false to disable this message): Unexpected Exception caught setting 'maxrow' on 'class com.hx.system.action.ManagerUserAction: Error setting expression 'maxrow' with value ['10', ]
设置struts.devMode=false,就没这种提示了.struts2.3.15.1校验严格了,开发模式下任何参数有提交但是没有对应set方法的时候都会有提示.