标签:
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1.com.opensymphony.xwork2.ActionSupport 类是默认的 Action 类. 若某一个Action 节点没有配置Class 属性,则ActionSupport 即为待执行的Action 类,而execute 方法即为要默认执行的action 类
1 <!-- 若为指定class 默认的action类就是 ActionSupport -->
2 <action name="testActionSupport">
3 <result>/success.jsp</result>
4 </action>
5
6 <!-- 等同 -->
7 <action name="testActionSupport" class="com.opensymphony.xwork2.ActionSupport" method="execute">
8 <result name="success">/success.jsp</result>
9 </action>
2.在手工完成验证,显示错误消息,国际化等情况,推荐继承ActionSupport
3.关于ActionSurppot 说明
public class ActionSupport implements Action, Validateable, ValidationAware, TextProvider, LocaleProvider, Serializable {
//代码
......
}
Validateable:验证接口; ValidationAware:验证消息接口,类级别,字段级别 ; TextProvider,LocaleProvider:国际化接口;
[原创]java WEB学习笔记57:Struts2学习之路---ActionSupport类的说明
标签:
原文地址:http://www.cnblogs.com/jasonHome/p/5790121.html