struts2页面访问action的具体方法
struts2页面访问action的具体方法报错了:
jsp:
通配符匹配方法:
<a href="<%=path %>/User!add.action">增加</a>
<a href="<%=path %>/User!show.action">查看</a>
<a href="<%=path %>/User!update.action">修改</a>
<a href="<%=path %>/User!delete.action">删除</a><br/><br/>
struts-xml:
<action name="User" class="lanjieqi.UserAction" method="{*}">
<result name="success">/index.jsp</result>
</action>
action:
public class UserAction extends ActionSupport{
public String add() throws Exception {
System.out.println("欢迎进入offic添加方法");
return SUCCESS;
}
public String show() throws Exception {
System.out.println("欢迎进入offic查看方法");
return SUCCESS;
}
public String update() throws Exception {
System.out.println("欢迎进入offic修改方法");
return SUCCESS;
}
public String delete() throws Exception {
System.out.println("欢迎进入offic删除方法");
return SUCCESS;
}
}
我一点击a标签报错:
There is no Action mapped for namespace [/] and action name [Usershow] associated with context path [/struts2-xml-demo4]. - [unknown location]
不知道哪里错了,求指教给分!