struts2的method执行
来源:互联网 发布:遗传算法的书pdf版本 编辑:程序博客网 时间:2024/05/22 17:12
execute()是Action的默认方法。Struts2还可以执行其他方法。只要这些方法没有参数,并返回String类型。这些方法也可以有throw声明,也可以没有
① 通过URL执行Action的方法:推荐
http://localhost:8080/工程名/packagename/actionname!*.action
<actionname="user"class="action.UserAction">
<result>/user_add_success.jsp</result>
</action>
② 将执行方法配置到Action
http://localhost:8080/工程名/actionname/method
<actionname="userAdd"class="struts2.user.action.UserAction"method="add">
<result>/user_add_success.jsp</result>
</action>
③使用通配符
<ahref="actions/Studentadd">添加学生</a>
<ahref="actions/Studentdelete">删除学生</a><br>
<action name="Student_add"></action>
<actionname="Student*"class="action.StudentAction"method="{1}">
<result>/student{1}_success.jsp</result>
</action>
<ahref="actions/Teacher_add">添加老师</a>
<ahref="actions/Teacher_delete">删除老师</a>
<ahref="actions/Course_add">添加课程</a>
<ahref="actions/Course_delete">删除课程</a>
<actionname="*_*"class="struts2.user.action.{1}Action"method="{2}">
<result>/{1}_{2}_success.jsp</result>
</action>
- struts2的method执行
- 动态获取Struts2执行动作的Method Name
- Struts2 2.5版本执行index 不执行指定method
- struts2的method="{1}"
- struts2的method="{1}"
- Struts2的method{1}用法
- struts2的method="{1}"
- Struts2不使用自带标签库执行method方法
- struts2的执行流程
- struts2的执行原理
- struts2的执行流程
- Struts2的执行过程
- struts2的执行原理
- struts2的执行流程
- struts2的执行流程
- struts2的执行机制
- Struts2的执行流程
- struts2的执行原理
- OCJP(1Z0-851) 模拟题分析(四)
- Multi-Threading Note
- UVa 120 - Stacks of Flapjacks
- 《齐物论》篇1
- 【转】JPEG压缩原理
- struts2的method执行
- CF-27D. Ring Road 2(涂色)
- 路径问题
- CF-27E - Number With The Given Amount Of Divisors(枚举+dfs)
- Healthy Holsteins
- 奥丁科技出的三国2秘籍是什么?
- 命名空间
- log4j警告的解决办法
- 性能调优攻略