日期:2014-05-18  浏览次数:20738 次

webwork2自动赋值问题
webwork2 int型字段price01,如果页面什么都不添写,抛:

OgnlValueStack - Error setting value
ognl.OgnlException: price01 [java.lang.IllegalArgumentException]
at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:83)
at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131)
at com.opensymphony.xwork.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:67)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.ASTChain.setValueBody(ASTChain.java:172)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
at ognl.SimpleNode.setValue(SimpleNode.java:246)
at ognl.Ognl.setValue(Ognl.java:476)
at com.opensymphony.xwork.util.OgnlUtil.setValue(OgnlUtil.java:188)
at com.opensymphony.xwork.util.OgnlValueStack.setValue(OgnlValueStack.java:162)
at com.opensymphony.xwork.util.OgnlValueStack.setValue(OgnlValueStack.java:145)
at com.opensymphony.xwork.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:144)
at com.opensymphony.xwork.interceptor.ParametersInterceptor.before(ParametersInterceptor.java:119)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:30)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190)
at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116)
at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:225)
at com.opensymphony.webwork.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:202)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
/-- Encapsulated exception ------------\

有遇到过的兄弟帮忙解决下。


------解决方案--------------------
改成Integer试试
------解决方案--------------------
帮顶
------解决方案--------------------
应该是参数类型有问题!
------解决方案--------------------
addBathInteger
------解决方案--------------------
ParametersInterceptor.java:144

跟到这看看阿。

webwork 属性和jsp页面是一一对应的.
------解决方案--------------------
探讨
ParametersInterceptor.java