继承ActionSupport类及Result结果集介绍

继承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结果集:


转发:


你可能感兴趣的:(ssh)