www.pudn.com > struts2.rar > RegisterAction2.java, change:2009-08-20,size:708b


package com.test.action; 
 
import com.opensymphony.xwork2.ActionSupport; 
import com.opensymphony.xwork2.ModelDriven; 
import com.opensymphony.xwork2.Preparable; 
import com.test.bean.User; 
 
public class RegisterAction2 extends ActionSupport implements ModelDriven<User>,Preparable  { 
	//模型驱动 
	User user = new User(); 
	public User getModel() { 
		// TODO Auto-generated method stub 
		return user; 
	} 
	 
 
	@Override 
	public String execute() throws Exception { 
		// TODO Auto-generated method stub 
		return SUCCESS; 
	} 
 
	public void prepare() throws Exception { 
		// TODO Auto-generated method stub 
		System.out.println("我是在数据类型转换、输入校验、execute方法之前被执行的。"); 
	} 
}