[Struts2] No result defined for action ... and result input & Invalid field value for field ...
2017-07-11 13:18
525 查看
"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中属性的类型。
能够建立一个内容为例如以下的Jsp文件。并在配置文件里配置result为input时跳转此文件。将会显示出详细的错误原因。
<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.gkwl.action.UserAction and result input
- Struts2疑难--No result defined for action com.marry.action.HqsyAction and result input
- struts2 上传文件 HTTP Status 404 - No result defined for action.....and result input
- 关于struts2上传文件报错“No result defined for action 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.....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 xxx.action and result input
- 关于"No result defined for action com.ccxe.credit.action.ReportAction and result input"的错误
- No result defined for action action.UploadAction 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 com.jcyj.action.fitting.FittingsAction and result input
- 使用Struts2显示No result defined for action XXXXAction and result input
- struts2的No result defined for action 。。。。and result input 问题
- [SSH]Struts2 -- No result defined for action and result input