Package formbeans

Examples of formbeans.LoginForm


    if(button == null) {
      return "homepage.jsp";
    }
        if(button.equals("login")){
          try {
            LoginForm form = formBeanFactory.create(request);
            request.setAttribute("loginform",form);
           
            if (!form.isPresent()) {
              return "error.jsp";
            }
           
            // direct registered people to your jsp file.
            User registeruser = (User) request.getSession(true).getAttribute("user");
            if (registeruser != null) {
              errors.add("You are already logged in.");
              return "haslogin.jsp";
            }
           
            //Do Validation,if there was something wrong, return to the homepage.
            errors.addAll(form.checkLoginFormErrors());
            if (errors.size() != 0) {
              return "homepage.jsp";
            }
           
            // Look up the user login in.
            User user1 = userDAO.lookup(form.getEmailaddress());  
            if (user1 == null) {
              errors.add("The user does not exist!");
              return "homepage.jsp";
            }else if (!user1.checkPassword(form.getPassword())) {
              errors.add("Incorrect password");
              return "homepage.jsp";
            }
         
          /*
 
View Full Code Here

TOP

Related Classes of formbeans.LoginForm

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.