从2.3.1.2升级到struts 2.3.14.2后获取有关OGNL异常的开发者通知

时间:2013-06-14 10:42:59

标签: struts

我使用struts 2.3.1.2构建了我的Web应用程序。我有以下页面/操作,我没有得到任何OGNL异常作为警告/通知。

  1. JSP页面 - 包含3个文本字段名称,地址,电话
  2. struts.xml文件 - devMode = true以及使用默认拦截器堆栈的相应操作条目
  3. 动作类,其中我只有两个请求参数的属性,即名称和地址
  4. 上面运行正常,我没有收到任何警告/通知异常。

    现在,我最近已升级到struts 2.3.14.2而且我已经开始在日志文件中获得警告/通知异常:

    Developer Notification (set struts.devMode to false to disable this message): 
    
    Unexpected Exception caught setting 'start' on 'class com.xyz.DetailsActionSupport: 
    Error setting expression 'start' with value ['0', ] - Error setting expression 'start' with value ['0', ] - [unknown location]        at  
    com.opensymphony.xwork2.ognl.OgnlValueStack.handleRuntimeException(OgnlValueStack.java:201)  at
    com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:178) at
    com.opensymphony.xwork2.ognl.OgnlValueStack.setParameter(OgnlValueStack.java:152) at
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:329)   at
    com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:241)     at
    com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) and more ...
    

    通过谷歌搜索,找到了两个答案:

    1. 在pauts拦截器的struts.xml中添加排除参数
    2. 禁用struts.xml
    3. 中定义的开发模式

      我可以这样做,但是,不明白 struts版本中发生了哪些变化,所以它已经开始将异常打印为通知/警告?

      下面的链接将告诉我们它是如何显示警告异常的: http://struts.apache.org/release/2.3.x/docs/parameters-interceptor.html 请参阅上面链接

      中的 缺少参数警告 部分

0 个答案:

没有答案