/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package users;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import database.DBConn;

import beans.Users;

/** 
 * MyEclipse Struts
 * Creation date: 05-25-2008
 * 
 * XDoclet definition:
 * @struts.action path="/reg" name="reg" input="/reg.jsp" scope="request" validate="true"
 * @struts.action-forward name="login" path="/login.jsp"
 */
public class RegAction extends Action {
	/*
	 * Generated Methods
	 */

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		Reg reg = (Reg) form;// TODO Auto-generated method stub
		Users u = new Users();
		u.setName(reg.getName());
		u.setPwd(reg.getPwd());
		u.setEmail(reg.getEmail());
		new DBConn().reg(u);
		return mapping.findForward("login");
	}
}