struts2里,struts.devMode设为true的问题


2009-3-18 11:02:08 com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
严重: ParametersInterceptor - [setParameters]: Unexpected Exception caught setting 'submit' on 'class com.learning.action.LoginAction: Error setting expression 'submit' with value '[Ljava.lang.String;@19d6af'

我们知道struts2的ModelDriven利用ognl强大的的功能,给我们自动生成对象bean.在前台页面里面可以直接使用,但今天日志里面出现了这么一个错误,但发现程序没有出错,后来在网上查了查,发现在struts.xml文件里面有这么一个。当设为true时,html表单数据中有和action属性匹配不上的参数名时就会提示这样的信息。我试了一下,果然如此,因此在开发过程中将这个属性设为true还是不错的,可以帮我们发现一些可能出现的问题。

    <constant name="struts.devMode" value="true"/>


你可能感兴趣的:(html,xml,bean,struts)