package com.jspdev.ch17;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.*;

/**
 *这是一个比较复杂的Form
 */
public class TestUserForm extends ActionForm
{
	public String userName;
	public String password;
	public int age; 
	public int sex;
	public String description;
	public String[] hob;

	public void setSex(int sex)
	{
		this.sex=sex;
	}
	public int getSex()
	{
		return this.sex;
	}
	public String[] getHob()
	{
		return this.hob;
	}
	public String getDescription()
	{
		return this.description;
	}
	public void setHob(String[] hob)
	{
		this.hob=hob;
	}
	public void setDescription(String description)
	{
		this.description=description;
	}
	
	public void setUserName(String name)
	{
		this.userName=name;
	}
	public void setPassword(String password)
	
	{
		this.password=password;
	}
	public String  getUserName()
	{
		return this.userName;
	}
	public String getPassword()
	{
		return password;
	}
	public int getAge()
	{
		return this.age;
	}
	public void setAge(int age)
	{
		this.age=age;
	}
	
	//重新设置form
	public void reset(ActionMapping mapping, HttpServletRequest request)
    {
                
    }
    //form有效性判断，这里做简化处理。
     public ActionErrors validate(ActionMapping mapping,
                    HttpServletRequest request)
     {
        ActionErrors errors = new ActionErrors();
       
        return errors;
     }
}
                
    