struts2报错: No result defined for action and result input

来源:互联网 发布:全家福相册排版软件 编辑:程序博客网 时间:2024/06/06 20:37

原因: 参数类型转换错误, validation失败

解决:

<%@ taglib prefix="s" uri="/struts-tags"%>

<div style="color:red">
    <s:fielderror />
</div>
它就会显示拦截器的错误,并在struts的XML中对应action里加如
<result name="input">/AddProducts.jsp</result>
让他把错误返回到该页面就可以了


原创粉丝点击