首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 企业软件 > 行业软件 >

Struts2的Action多方面法调用

2012-10-08 
Struts2的Action多方法调用Action多方法调用??? ??? 方式一:??? ??? ??? 在struts.xml中的action标签中添

Struts2的Action多方法调用

Action多方法调用
??? ??? 方式一:
??? ??? ??? 在struts.xml中的action标签中添加method值如:
??? ????
??? ??? ??? <!-- 没有method属性值则这是MyTestAction默认的调用方法即execute方法将被调用 -->
??? ??? ??? <action name="myTest" method="text1">
??? ??? ??? ??? <result name="success">/index.jsp</result>
??? ??? ??? </action>??? ????
??? ????
??? ??? 方式二:
??? ??? ??? 在struts.xml中的action标签不改
??? ??? ??? <action name="myTest" method={1}>

??? ??? ??? ??? <result name="success">/index.jsp</result>
??? ??? ??? </action>?? ??? ??? ??? ??? ????
??? ??? ??? 页面:
??? ??? ??? <a href="myTest.action">Action默认的方法</a><br>
??? ??? ? ??? <a href="myTest_text1.action">Action的text1方法</a><br>

??? ??? ? ??? <a href="myTest_text2.action">Action的text2方法</a>

热点排行