今天遇到一个比较郁闷的问题,异常如下:
2009-11-06 21:26:13,515 [http-126-Processor21] WARN [com.opensymphony.xwork2.ognl.OgnlValueStack] - Error setting value
ognl.ExpressionSyntaxException: Malformed OGNL expression: 8aa0a19c2474a294012474b307a6000a [ognl.ParseException: Encountered "aa0a19c2474a294012474b307a6000a" at line 1, column 2.
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:116)
at com.opensymphony.xwork2.ognl.OgnlUtil.compile(OgnlUtil.java:207)
at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:192)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:155)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:143)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:273)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at org.apache.struts2.interceptor.MessageStoreInterceptor.intercept(MessageStoreInterceptor.java:204)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)
/-- Encapsulated exception ------------\
ognl.ParseException: Encountered "aa0a19c2474a294012474b307a6000a" at line 1, column 2.
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.OgnlParser.generateParseException(OgnlParser.java:3157)
at ognl.OgnlParser.jj_consume_token(OgnlParser.java:3034)
at ognl.OgnlParser.topLevelExpression(OgnlParser.java:18)
at ognl.Ognl.parseExpression(Ognl.java:113)
at com.opensymphony.xwork2.ognl.OgnlUtil.compile(OgnlUtil.java:207)
at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:192)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:155)
at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:143)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:273)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at org.apache.struts2.interceptor.MessageStoreInterceptor.intercept(MessageStoreInterceptor.java:204)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)
\--------------------------------------/
经过一番检查异常,挨个排查错误,最后终于发现问题。
Error setting value
2.ognl.ExpressionSyntaxException: Malformed OGNL expression: 8aa0a19c2474a294012474b307a6000a [ognl.ParseException: Encountered "aa0a19c2474a294012474b307a6000a" at line 1, column 2.
原来是因为我的表单中有几个隐藏域使用了以数字开头的name值,改正过来后,就不在报这个错了!
分享到:
相关推荐
通常,这种问题发生在用户在提交表单后,由于网络延迟或用户的误操作再次点击提交按钮,或者在表单提交后刷新浏览器页面。这两种情况都可能导致服务器接收到重复的请求,从而对系统造成不必要的负担,甚至可能导致...
6. **Struts2 Action处理**:在后台,Struts2 Action会接收到Ajax请求,对提交的数据进行校验,如果一切正常,可以进行业务逻辑处理,如保存用户信息,否则返回错误信息。 7. **反馈结果**:最后,前端根据Ajax请求...
总结来说,Struts1.2处理包含列表对象的表单提交涉及到表单设计、ActionForm的创建、Action类的编写以及Struts框架的内部机制。通过理解这些知识点,开发者能够有效地管理用户输入的复杂数据结构,并在后端进行处理...
- **提交与验证**:当表单提交时,服务器获取表单中的Token,与Session中的Token进行比对。如果匹配,处理表单数据;如果不匹配或Session中没有对应的Token,说明是重复提交,服务器则忽略此次请求。 - **清理...
当表单提交时,服务器检查令牌是否已存在于session或请求中,如果存在且与提交的令牌匹配,则处理请求,否则忽略。 - **Session级的Action状态管理**:每个Action实例在处理完请求后存入session,如果再次收到相同...
struts2防止表单重复提交,利用struts的拦截器tokenSession,轻轻松松解决表单重复提交的问题。 附件为源代码,后台延迟了3秒,可直接在web服务器下部署运行,输入用户名和密码后,多点几次提交按钮,然后看控制台...
在处理表单提交时,Struts2的`<s:form>`标签起着关键作用。它会自动将表单数据绑定到Action类的属性,并且提供了一些有用的功能,如表单验证、主题样式和URL映射等。一个基本的`<s:form>`标签示例如下: ```jsp ...
3. **表单提交**:用户填写完表单并提交后,Struts2拦截器会自动将表单中的令牌值与session中的令牌进行比较。 4. **验证令牌**:如果两者匹配且令牌未被使用过,那么处理表单请求;若不匹配或令牌已被使用,Struts...
在Struts2中,防止重复提交是一个重要的问题,因为它可能导致数据不一致性和服务器资源的浪费。本文将详细介绍如何在Struts2中解决这个问题,以及相关的技术概念。 首先,我们要理解Struts2中的拦截器(Interceptor...
Struts2是一个非常流行的Java Web框架,用于构建和维护可扩展且易于管理的企业级应用程序。在Web开发中,表单重复提交是一个常见的问题,可能导致数据不一致或处理逻辑的混乱。Struts2提供了多种方法来防止这种情况...
在处理用户表单提交时,Struts框架可能会遇到一个常见的问题,即表单重复提交。这种情况通常发生在用户点击提交按钮后,由于网络延迟或其他原因导致请求被多次发送,从而可能对服务器端造成多次数据插入或更新,导致...
在处理表单提交时,一个常见的问题就是防止用户意外或恶意地重复提交数据,这可能导致数据库中的数据异常。"防止表单重复提交 token"是Struts2提供的一种解决方案,通过在请求中加入一个唯一的token来确保请求的唯一...
在这个名为"Struts2表单数据获取项目"的资源中,我们将深入探讨如何使用Struts2框架来处理表单提交的数据。 首先,我们来看看核心组件`Struts.xml`。这是Struts2应用的主要配置文件,用于定义动作(Actions)、结果...
### Struts2 OGNL 表单提交问题详解 #### 一、背景介绍 Struts2框架作为一款流行的企业级应用开发框架,在处理MVC架构方面有着独特的优势。其中,OGNL (Object-Graph Navigation Language) 作为一种强大的表达式...
Struts2提供了Token插件来解决这个问题,确保每个表单提交只能被执行一次。下面将详细阐述Struts2中Token机制的工作原理、配置以及使用方法。 1. Token机制概述: Token机制是通过在客户端(浏览器)和服务器之间...
在Struts2中,表单验证是非常重要的一个环节,它确保了用户输入的数据符合预设的规则,从而保证了应用程序的数据质量和安全性。本示例主要讲解的是使用XML文件进行表单验证的方法。 首先,让我们理解表单验证的基本...
根据提供的文件信息,本文将详细解释“Struts2表单提交”中涉及到的关键知识点,包括如何在Java程序中获取MySQL数据库连接(地址、密码、权限)的过程。 ### Struts2框架简介 Struts2是Apache基金会下的一个开源...
在处理表单数据方面,Struts2提供了一种高效且灵活的方法,使得开发者能够轻松地从用户提交的表单中获取并处理数据。这篇博客文章“应用Struts2处理表单数据”可能会探讨以下核心知识点: 1. **Action类**:在...