在开发中遇到了这种错误,代码提示:
ERROR 2011/08/04 08:16:11,757 [org.apache.struts2.dispatcher.Dispatcher:27] - Could not find action or result
No result defined for action xx.quanxian.action.LoginAction and result success
at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:363)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)
是在一个登陆时,不论输入对错,都停在登陆界面不动,后台报错。配置文件没错。跪求高手帮忙!

解决方案 »

  1.   

    Could not find action or result
     包从新导入下
    项目remove   重新导入下
      

  2.   

    LZ你参考一下哦
    No result defined for action …… and result success
          <action name="login" class="com.netshop.action.LoginAction">
                <result name="SUCCESS">/admin/main.jsp</result>
               <result name="failure">/admin/login.jsp</result>
            </action>原因:result元素中的name值应该为小写,本以为login.action中返回的是SUCCESS,result中也应该为大写,没想到竟然出错。解决:name="success"
      

  3.   

    <action>没有<result>子元素吧、格式可以参考楼上的,不过大小写没什么关系,都当字符串处理