Struts.xml:
<constant name="struts.devMode" value="true" />
<package name="stu" extends="struts-default" namespace="">
<action name="stu" class="com.stu.strust2.action.IndexAction">
<result>/hello.jsp</result>
</action>
</package>
IndexAction.java:
public class IndexAction extends ActionSupport{
public String add(){
return "success";
}
}
index.jsp:
<a href="<%=path%>/stu/stu!add">Action的案例!</a>
错误:Could not find action or result
There is no Action mapped for action name stu!add. - [unknown location]