随机出现“No result defined for action ....Action and result input”解决
2017-12-03 21:30
344 查看
最近一次系统升级,随机出现编辑原来数据库数据失败问题,而如果修改这个action所有数据则可以成功,新添加再修改也可以成功。跟踪发现系统报错:
[java] view
plain copy
No result defined for action com.jim.web.action.appointment.AppointmentAction and result input
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:376)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:278)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
再到代码中跟踪发现:
[java] view
plain copy
WARN OgnlValueStack:60 - Error setting expression 'appointment.customerId' with value '[Ljava.lang.String;@15475116'
ognl.MethodFailedException: Method "setCustomerId" failed for object com.jim.bean.appointment.Appointment@18f75278 [java.lang.NoSuchMethodException: com.jim.bean.appointment.Appointment.setCustomerId([Ljava.lang.String;)]
.............................................................................................................
Caused by: java.lang.NoSuchMethodException: com.jim.bean.appointment.Appointment.setCustomerId([Ljava.lang.String;)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1233)
... 67 more
/-- Encapsulated exception ------------\
java.lang.NoSuchMethodException: com.jim.bean.appointment.Appointment.setCustomerId([Ljava.lang.String;)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1233)
............................................................................................................
\--------------------------------------/
09:25:59,222 ERROR Dispatcher:38 - Could not find action or result
/blackfoot/pages/booking/editAppointmentByJsonAction
No result defined for action com.jim.web.action.appointment.AppointmentAction and result input
发现是bean映射时变量类型错误导致请注意一下信息
“Error setting expression 'appointment.customerId' with value '[Ljava.lang.String”
在bean appointment中“customerId”是Integer类型,但jsp和js却直接映射成String,导致异常发什么。
在js中原来为
[java] view
plain copy
"appointment.customerId" :$("#customerId").val(),
jquery 从input获得的是一个String类型值,改正为获得值后直接强制转化为10进制 Integer类型
[java] view
plain copy
"appointment.customerId" :parseInt($("#customerId").val(),10),
后面“10”表示10进制,如果为“8”则为8进制,以此类推
问题解决。
[java] view
plain copy
No result defined for action com.jim.web.action.appointment.AppointmentAction and result input
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:376)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:278)
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
再到代码中跟踪发现:
[java] view
plain copy
WARN OgnlValueStack:60 - Error setting expression 'appointment.customerId' with value '[Ljava.lang.String;@15475116'
ognl.MethodFailedException: Method "setCustomerId" failed for object com.jim.bean.appointment.Appointment@18f75278 [java.lang.NoSuchMethodException: com.jim.bean.appointment.Appointment.setCustomerId([Ljava.lang.String;)]
.............................................................................................................
Caused by: java.lang.NoSuchMethodException: com.jim.bean.appointment.Appointment.setCustomerId([Ljava.lang.String;)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1233)
... 67 more
/-- Encapsulated exception ------------\
java.lang.NoSuchMethodException: com.jim.bean.appointment.Appointment.setCustomerId([Ljava.lang.String;)
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1233)
............................................................................................................
\--------------------------------------/
09:25:59,222 ERROR Dispatcher:38 - Could not find action or result
/blackfoot/pages/booking/editAppointmentByJsonAction
No result defined for action com.jim.web.action.appointment.AppointmentAction and result input
发现是bean映射时变量类型错误导致请注意一下信息
“Error setting expression 'appointment.customerId' with value '[Ljava.lang.String”
在bean appointment中“customerId”是Integer类型,但jsp和js却直接映射成String,导致异常发什么。
在js中原来为
[java] view
plain copy
"appointment.customerId" :$("#customerId").val(),
jquery 从input获得的是一个String类型值,改正为获得值后直接强制转化为10进制 Integer类型
[java] view
plain copy
"appointment.customerId" :parseInt($("#customerId").val(),10),
后面“10”表示10进制,如果为“8”则为8进制,以此类推
问题解决。
相关文章推荐
- 随机出现“No result defined for action ....Action and result input”解决
- struts2环境配置是出现No result defined for action *** and result input”的错误信息
- HTTP Status 404 - No result defined for action EmployeeAction and result input - action类似异常解决及原因剖析
- No result defined for action action and result input 解决办法——struts2 文件上传
- HTTP Status 404 - No result defined for action EmployeeAction and result input - struts2类似异常解决及原因剖析
- 解决 No result defined for action xxxAction and result input
- Struts2问题,已解决No result defined for action and result input
- 解决No result defined for action action.bookstore.AddInfoAction and result input
- 关于Struts2报"No result defined for action +(包名) and result input"的解决方法
- 关于No result defined for action com.gen.action.FrontAction and result input解决方法
- No result defined for action ** and result input 解决
- struts2:No result defined for action com.jcyj.action.fitting.FittingsAction and result input
- No result defined for action and result input
- No result defined for action and result input
- 【填大坑】关于Struts2中的 No result defined for action and result input 错误
- No result defined for action xxxAction and result input
- No result defined for action and result input异常
- struts2 在拦截器里报错:No result defined for action com.gkwl.action.UserAction and result input
- No result defined for action XXX and result XXX的问题解决方法
- Struts2-No result defined for action and result input