package register;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.Action;
public class RegisterAction extends Action
{
    public ActionForward execute(ActionMapping actionMapping,
       ActionForm actionForm, HttpServletRequest servletRequest,
       HttpServletResponse servletResponse)
{
        System.out.println("ÄÚ²¿¶¯×÷");
        RegisterActionForm registerActionForm = (RegisterActionForm) actionForm;
        String sub = registerActionForm.getAccept();
        if(sub.equals("submit"))
{
             System.out.println("1");
            return actionMapping.findForward("welcome");
                }
else if(sub.equals("accept"))
{
            System.out.println("2");
            registerActionForm.setAccepted(true);
            return actionMapping.findForward("register");
        }
else
{
             System.out.println("3");
            return actionMapping.findForward("index");
                }
    }
}

