继承ActionSupport类及Result结果集介绍

来源:互联网 发布:ubuntu uefi启动盘 编辑:程序博客网 时间:2024/05/21 07:06

继承ActionSupport类的作用:

public class ActionSupport implements Action, Validateable, ValidationAware, TextProvider, LocaleProvider, Serializable {

从上面的源码中可以看出,ActionSupport实现了上面点这些类,所以继承ActionSupport之后就具备了这些类的功能。

Validateable类具有验证功能,TextProvider类用于实现国际化功能。


Action的模式:

在action的构造器中输出一句话,在浏览器中多次请求该action,可以看到构造器执行了好多次,所以action是多例的。

public class ScopeAction extends ActionSupport{ScopeAction(){System.out.println("create action!");}public String execute(){System.out.println("hello");return "index";}}

Result结果集:


转发:


0 0
原创粉丝点击