No result defined for action and result input实用

这是struts2的一个拦截器报的错误,当你的form中的数据有问题,比如说
<input type="text" name="receiverLoginID" value="<%=name%>"/>
当 name值为NULL时,就出这个错了,所以你可以在当前页面加入以下标签
<div style="color:red">
    <s:fielderror />
</div>
它就会显示拦截器的错误,并在struts的XML中对应action里加如
<result name="input">/AddProducts.jsp</result>
让他把错误返回到该页面就可以了
posted @ 2015-04-03 22:41  剑芒  阅读(105)  评论(0编辑  收藏  举报