[Struts2] No result defined for action ... and result input & Invalid field value for field ...
2014-11-06 17:09
537 查看
"No result defined for action ... and result input"错误一般发生在Struts2的拦截器拦截时遇到了问题时,Struts2会将跳转到result为input的视图上,但是在配置文件中并没有给这个Action配置input的result。可以建立一个内容为如下的Jsp文件,并在配置文件中配置result为input时跳转此文件,将会显示出具体的错误原因。
如果Jsp显示的错误原因为"Invalid field value for field ...",说明Struts2的ParametersInterceptor在进行类型转换的时候出现了错误。例如时间格式错误、表单提交文件时没有使用Post方式或者没有加上“enctype="multipart/form-data"”。如果实在找不到错误原因,可以尝试在ParametersInterceptor的doIntercept方法中断点调试,查看ActionContext ac的parameters中属性的类型。
<div style="color:red"> <s:fielderror /> </div>
如果Jsp显示的错误原因为"Invalid field value for field ...",说明Struts2的ParametersInterceptor在进行类型转换的时候出现了错误。例如时间格式错误、表单提交文件时没有使用Post方式或者没有加上“enctype="multipart/form-data"”。如果实在找不到错误原因,可以尝试在ParametersInterceptor的doIntercept方法中断点调试,查看ActionContext ac的parameters中属性的类型。
相关文章推荐
- [Struts2] No result defined for action ... and result input & Invalid field value for field ...
- Struts2 项目报错 No result defined for action com.xxx.xxAction and result input
- Struts2报错:No result defined for action xxx and result input
- Struts2——No result defined for action and result input - action错误(今天也遇到,没见过很难找)
- Struts2问题,已解决No result defined for action and result input
- 关于struts2上传文件报错“No result defined for action and result input”
- Struts2报错:No result defined for *action and result input
- Struts2-No result defined for action and result input
- [SSH]Struts2 -- No result defined for action and result input
- struts2环境配置是出现No result defined for action *** and result input”的错误信息
- struts2 上传文件 HTTP Status 404 - No result defined for action.....and result input
- Struts2常见错误-No result defined for action XXX and result input
- struts2 在拦截器里报错:No result defined for action com.gkwl.action.UserAction and result input
- No result defined for action action and result input 解决办法——struts2 文件上传
- struts2的那些事儿--No result defined for action.....and result input
- struts2的No result defined for action 。。。。and result input 问题
- struts2 no result defined for action xxxx and result input
- 关于struts2上传文件报错“No result defined for action and result input”
- No result defined for action action.UploadAction and result input(开发错误记录struts2)
- struts2 No result defined for action.....and result input