您的位置:首页 > 编程语言 > Java开发

Struts2中Action中动态调用,为什么出错了???

2013-01-18 15:06 381 查看
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]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: