当前位置: 代码迷 >> Java Web开发 >> 急死人了!帮帮小弟,查查这个错吧!贴上代码了
  详细解决方案

急死人了!帮帮小弟,查查这个错吧!贴上代码了

热度:10011   发布时间:2016-04-10 22:49:50.0
急死人了!各位大哥帮帮小弟,查查这个错吧!贴上代码了
Could not find action or result There is no Action mapped for namespace / and action name login.----这个是错误提示
这是前端jsp代码:<form action="back.action" method="post">
          <input type="submit" value="主页"/>
          </form>
配置文件:<package name="login" namespace="/login" extends="json-default">
  <action name="toLogin">
   <result name="success">/WEB-INF/main/login.jsp</result>
  </action>
  <action name="login" class="com.shop.action.LoginAction">
   <result name="success">/WEB-INF/main/index.jsp</result>
   <result name="error">/WEB-INF/main/login.jsp</result>
  </action> 
  <action name="back" class="com.shop.action.BackindexAction">
   <result name="success">/WEB-INF/main/index.jsp</result>
  </action>
Action代码



package com.shop.action;

public class BackindexAction {
 public String execute(){
  System.out.println(1);
  return "success";
 }
}
Action代码



package com.shop.action;

public class BackindexAction {
 public String execute(){
  System.out.println(1);
  return "success";
 }
}
想从prodlist跳转到index.jsp 就是报错不行啊啊啊啊啊啊
prodlist.jsp 和 index.jsp 都在 web-inf 下面
------解决方案--------------------
<package name="login" namespace="/login" extends="json-default">
你配置namespace 应该在action前加出来<form action="login/back.action" method="post">
  相关解决方案