package chat2;

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 LoginAction extends Action {
    public ActionForward execute(ActionMapping mapping, ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response) {
        LoginActionForm loginActionForm = (LoginActionForm) form;
       String userName=loginActionForm.getUserName();
       String password=loginActionForm.getPassword();
       if(password.length()<8)
       {
           return mapping.findForward("error1");
       }
       else{
           return mapping.findForward("success");
       }


    }
}
