`

Struts2开发中的 No result defined for action 错误

 
阅读更多
error.jsp中的错误提示:No result defined for action zqq.action.LoginAction and result input 
struts.xml中的映射:
  <global-results>
   <!-- 下面定义的结果对所有的Action都有效 -->
   <result name="exception">/error.jsp</result>
   <result name="success">/success.jsp</result>
  </global-results>
  <global-exception-mappings>
   <!-- 指Action抛出Exception异常时,转入名为exception的结果。 -->
   <exception-mapping exception="java.lang.Exception" result="exception"/>
  </global-exception-mappings>
  <action name="Login" class="zqq.action.LoginAction">
       <result name="failure">/login.jsp</result>
  </action>
LoginAction的代码:
public String execute() throws Exception{
 return SUCCESS;
}

success你已经定义成全局的result了,看你贴出来的代码没什么问题呀。
从错误信息来看,是说没有定义result。 你有没有配置拦截器<interceptor-ref name="validation"/>?如果有的话,去掉所有的拦截器。 包括这个缺省的拦截器栈:<default-interceptor-ref name="defaultStack"/>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics