HTTP Status 404 - No result defined for action com.action.personAction and result input

struts2中进行有效性校验时练习的小例子中产生下面的报错信息:
   页面显示:HTTP Status 404 - No result defined for action com.action.personAction and result input

  控制台显示:
     警告: Could not find action or result
     No result defined for action com.action.personAction and result input

出错原因是:
  1)前台请求页面的属性值和action中对应的属性值写错了个单词,导致action获取不到,属性值为空。
Action中的属性值为空,Struts2的默认拦截器会报错,找不到input的result,不能把错误返回。只能报找不到result.

 
  2)在进行校验时,在配置文件中没有指定input返回视图

       系统包含fieldErrors失败信息时,struts2会将请求转发到name为input的result。在input视图中可以显示校验不通过的报错提示信息。通过:<%@taglib uri="/struts-tags" prefix="s"%>       <s:fielderror/>
         <action name = "validate_*" class = "com.action.personAction" method = "save">
              <result name="input">/index.jsp</result>  <!--少这行报错 -->
              <result name = "success" >/WEB-INF/page/validate.jsp</result>
         </action>

导致这个报错的原因太多...



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值