Could not find action or result There is no Action mapped for namespace / an
错误:CouldnotfindactionorresultThereisnoActionmappedfornamespace/andactionnameuser_del....
错误:Could not find action or result
There is no Action mapped for namespace / and action name user_del.
struts.xml:
<struts>
<package name="p1" extends="struts-default" namespace="/">
<action name="user_*" class="qau.LoginAction" method="{1}">
<result name="user_add">/add.jsp</result>
<result name="user_del">/del.jsp</result>
</action>
</package>
</struts>
LoginAction.java:
public class LoginAction extends ActionSupport {
public String add(){
return"add";
}
public String del(){
return"del";
}
}
index.jsp:
<body>
<a href="user_add.action">添加</a> <br/>
<a href="user_del.action">删除</a> <br/>
</body> 展开
There is no Action mapped for namespace / and action name user_del.
struts.xml:
<struts>
<package name="p1" extends="struts-default" namespace="/">
<action name="user_*" class="qau.LoginAction" method="{1}">
<result name="user_add">/add.jsp</result>
<result name="user_del">/del.jsp</result>
</action>
</package>
</struts>
LoginAction.java:
public class LoginAction extends ActionSupport {
public String add(){
return"add";
}
public String del(){
return"del";
}
}
index.jsp:
<body>
<a href="user_add.action">添加</a> <br/>
<a href="user_del.action">删除</a> <br/>
</body> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询