您的位置:首页 > 其它

No result defined for action ** and result input 解决

2013-11-27 16:17 483 查看
The error message means that an result named
input
has not been defined for your action. The result
input
is a default result returned by Struts when there is a problem with validating the parameters passed to an action. Thus, I recommend to
check and ensure that the parameters you are passing from your HTML form match the parameters of your action. Check spelling, data types etc

INPUT:Action的执行,需要从前端界面获取参数,INPUT就是代表这个参数输入的界面,一般在应用中,会对这些参数进行验证,如果验证没有通过,将自动返回到该视图。

用加注塑方法排除,结果是html与action某些数据类型不一致

我在动作的第一个语句前加断点,发现根本就没有进动作,现在想来原因是struts2是先经过拦截器,再到动作,这个流程我以前也知道,但没放在心上,这次就是拦截器爆出的错,然后直接就不经过动作了,害我找了很久的错,才重新回忆起这个流程,最后我在动作所在类中加了一个方法

[java]
view plaincopy

public void validate() {
if(article != null)
System.out.println(article.getCategory());
}

在if语句处打断点,断点就能起作用,验证了我的想法。这种方法以后可以用来检查未进入动作(action)的原因。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐