No result defined for action *Action and result input - action

No result defined for action *Action and result input - action -

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

No result defined for action *Action and result input - action -
.......

在 struts2 中,如果页面或者控制台报以上的错误,那么可以肯定你没有配置 <result type="input">xxx.jsp</result>
这个是验证时指定输出的页面,必须要写的,最好与你输入页面时同一个
但这只是从字面意思的理解,struts2中默认的是如果错误发生就跳转到input

而且你所定义的 action 可能也有问题。
有的时候可能你写的重定向如以下
<result type="redirect">yyy.action</result>
那么它也将出现以上的错误。因为你本就不想要 result type="input"

那么最好你使用以下的方式进行 action 的重定向操作
因为它将把 action 中的属性及定义传递下去而上面的方式是不行的。
<result type="redirect-action">yyy.action</result>

如果不是上面所提的问题,还是报错的话
那就是你页面上的数据与action中对应属性的数据类型不匹配导致的
查看action中的属性的get set方法是否都有
然后再看看类型 这点很重要 我这个问题找了老半天

你可能感兴趣的:(jsp)