Package formbeans

Examples of formbeans.RegisterForm


        //errors.add("You are already logged in.");
        return "haslogin.jsp";
      }
       
      try {
          RegisterForm form = formBeanFactory.create(request);
          request.setAttribute("registerform",form);
          if (!form.isPresent()) {
              return "register.jsp";
          }
          /*
           * If there are something wrong with the user input,
           * e.g. no password, fail to repeat password ,
           *
           */
          //System.out.println("the eamil address is " + form.getUserName());
          errors.addAll(form.registerCheckErrors());
          if (errors.size()!= 0) {
              return "register.jsp";
          }
          //check duplicated registration.
          User checkuser = userDAO.lookup(form.getUserName());
          if( checkuser != null){
            errors.add("User with that email already exists.");
            return "register.jsp";
          }
          // Create the user bean
          User user = new User(form.getUserName());
          user.setPassword(form.getPassword());
      user.setFirstName(form.getFirstName());
      user.setLastName(form.getLastName());
      user.setGender(form.getGender());
          userDAO.create(user);  
      /*
       * After successful registration, redirectTo personal page.
       */
          HttpSession session = request.getSession(false);
View Full Code Here

TOP

Related Classes of formbeans.RegisterForm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.