连字符(-)的OGNL表达不当

时间:2018-07-19 11:44:01

标签: java exception struts2 weblogic12c ognl

我正在Weblogic12C应用程序服务器中运行的Struts 2应用程序的“请求”参数中,将设备名称和设备版本传递为 device-name device-version

应用程序从请求中获取值并且工作正常,但是 ognl InappropriateExpressionException 正在服务器日志中连续打印。 即使在添加了如下的 excludeParams 属性之后

<interceptor-stack name="commonStack">
        <interceptor-ref name="timer"/>
        <interceptor-ref name="SessionInterceptor"/>
        <interceptor-ref name="defaultStack" />
        <interceptor-ref name="params">
         <param name="excludeParams">dojo..*,device-*</param>
        </Interceptor-ref>
</interceptor-stack>

我得到的异常如下

  

使用值设置表达式'device-version'时出错   '[Ljava.lang.String; @ 1012dde9'ognl.InappropriateExpressionException:   不适当的OGNL表达式:设备-版本           在ognl.SimpleNode.setValueBody(SimpleNode.java:312)           在ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)           在ognl.SimpleNode.setValue(SimpleNode.java:301)           在ognl.Ognl.setValue(Ognl.java:737)           在com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:218)           在com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(OgnlValueStack.java:187)           在com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:174)           在com.opensymphony.xwork2.ognl.OgnlValueStack.setParameter(OgnlValueStack.java:152)           在com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:318)           在com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:230)           在com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:238)           在com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:73)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:252)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)           在com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)          在   com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在com.tcs.interceptors.SessionInterceptor.intercept(SessionInterceptor.java:134)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在com.opensymphony.xwork2.interceptor.TimerInterceptor.invokeUnderTiming(TimerInterceptor.java:135)           在com.opensymphony.xwork2.interceptor.TimerInterceptor.intercept(TimerInterceptor.java:122)           在com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)           在org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)           在org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:544)           在org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)           在org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)           在weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)           在com.tcs.common.filter.GZIPFilter.doFilter(GZIPFilter.java:114)           在weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)           在weblogic.servlet.internal.WebAppServletContext $ ServletInvocationAction.wrapRun(WebAppServletContext.java:3683)           在weblogic.servlet.internal.WebAppServletContext $ ServletInvocationAction.run(WebAppServletContext.java:3649)           在weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)           在weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)           在weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)           在weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)           在weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433)           在weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281)           在weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259)           在weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691)           在weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651)           在weblogic.servlet.provider.ContainerSupportProviderImpl $ WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)           在weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)           在weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)           在weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)           在weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)           在weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)           在weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)           在weblogic.work.ExecuteThread.run(ExecuteThread.java:346)

0 个答案:

没有答案