---
title: "No result defined for action and result input"
author: "lyb520320"
date: "2011-03-09T17:24:37Z"
tags: []
categories: ["企业架构"]
slug: "no-result-defined-for-action-and-result-input"
draft: false
lastmod: "2011-03-09T17:24:37Z"
id: 949102
url: "https://lyb520320.iteye.com/blog/949102"
---

这是struts2的一个拦截器报的错误,当你的form中的数据有问题,比如说  
&lt;input type="text" name="receiverLoginID" value="&lt;%=name%&gt;"/&gt;  
当 name值为NULL时,就出这个错了,所以你可以在当前页面加入以下标签  
&lt;div style="color:red"&gt;  
    &lt;s:fielderror /&gt;  
&lt;/div&gt;  
它就会显示拦截器的错误,并在struts的XML中对应action里加如  
&lt;result name="input"&gt;/AddProducts.jsp&lt;/result&gt;  
让他把错误返回到该页面就可以了