码迷,mamicode.com
首页 > 其他好文 > 详细

[Struts2] No result defined for action ... and result input & Invalid field value for field ...

时间:2014-11-06 22:08:59      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:result input   invalid field value   parametersintercepto   enctypemultipartform   struts2   

"No result defined for action ... and result input"错误一般发生在Struts2的拦截器拦截时遇到了问题时,Struts2会将跳转到result为input的视图上,但是在配置文件中并没有给这个Action配置input的result。可以建立一个内容为如下的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 ...

标签:result input   invalid field value   parametersintercepto   enctypemultipartform   struts2   

原文地址:http://blog.csdn.net/sinat_19425927/article/details/40864321

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!