获取OgnlValueStack错误设置表达式'6578706f7274',其值为'[Ljava.lang.String; @ 1afb661'

时间:2014-01-22 12:41:52

标签: java displaytag

我正在使用带有Struts2的DisplayTag进行分页和导出选项,Pagination工作正常但是当我点击导出链接时,它在控制台上显示错误/警告消息。

            16:29:23,171 WARN  [OgnlValueStack] Error setting expression '6578706f7274' with value '[Ljava.lang.String;@1afb661'
            ognl.ExpressionSyntaxException: Malformed OGNL expression: 6578706f7274 [ognl.ParseException: Encountered " <INT_LITERAL> "7274 "" at line 1, column 9.
            Was expecting one of:
            <EOF> 
            "," ...
            "=" ...
            "?" ...
            "||" ...
            "or" ...
            "&&" ...
            "and" ...
            "|" ...
            "bor" ...
            "^" ...
            "xor" ...
            "&" ...
            "band" ...
            "==" ...
            "eq" ...
            "!=" ...
            "neq" ...
            "<" ...
            "lt" ...
            ">" ...
            "gt" ...
            "<=" ...
            "lte" ...
            ">=" ...
            "gte" ...
            "in" ...
            "not" ...
            "<<" ...
            "shl" ...
            ">>" ...
            "shr" ...
            ">>>" ...
            "ushr" ...
            "+" ...
            "-" ...
            "*" ...
            "/" ...
            "%" ...
            "instanceof" ...
            "." ...
            "(" ...
            "[" ...
            <DYNAMIC_SUBSCRIPT> ...
            ]
            at ognl.Ognl.parseExpression(Ognl.java:112)
            at com.opensymphony.xwork2.ognl.OgnlUtil.compile(OgnlUtil.java:225)
            at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:209)
            at com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(OgnlValueStack.java:173)
            at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:160)
            at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:151)
            at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:288)
            at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:199)
            at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)
            at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:270)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
            at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)
            at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)
            at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
            at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:498)
            at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
            at java.lang.Thread.run(Thread.java:662)

这是生成excel报告的动作网址

            xyz.action?
            paramBean.st=02-07-2012+00%3A00
            &paramBean.type=0
            &paramBean.et=04-07-2012+00%3A00
            &paramBean.did=294
            &6578706f7274=1
            &didSearch=Rishin-Scorpio
            &paramBean.ust=1341167400
            &d-49216-e=2
            &go=GO
            &paramBean.uet=1341340259

据我所知,问题可能是url中的6578706f7274,它在OGNL中映射为对象。 请让我知道出了什么问题

1 个答案:

答案 0 :(得分:0)

实际上,我怀疑您的实际请求网址确实包含

  &6578706f7274=[Ljava.lang.String;@1afb661

...就像异常消息所说的那样。

如果您尝试通过调用String[]Object.toString()对象转换为String,您会得到类似的内容。查看创建请求的代码,并检查是否使用正确类型的对象来提供该请求参数的值。