@RequestMapping(value = "loginform",method = RequestMethod.POST)
        public String processForm(@Valid LoginForm loginForm, BindingResult result,
                        Map<String, LoginForm> model, RedirectAttributes redirectAttributes) throws ClassNotFoundException, SQLException{

        	LoginDao ldao = new LoginDao();
            String role,pwd;
            String user = "user";
            String employee = "employee";
            String admin = "admin";
            String defpwd = "pwd001";
            if (result.hasErrors()) {
                   return "loginform";
            }
            loginForm = (LoginForm) model.get("loginForm");
            role = ldao.login(loginForm);
            pwd = loginForm.getPassword();
            System.out.println(role); 
            loginForm.setRole(role);
            redirectAttributes.addFlashAttribute("loginForm",loginForm);
            if(admin.equals(role)){
                 return "redirect:adminsuccess"; 
            } else if(employee.equals(role))	 {
            	System.out.println("employee loginsuccess");
            	if(pwd.equalsIgnoreCase(defpwd)) { 
            		return "redirect: changePwd";
            	}
                return "redirect:employeesuccess"; 
            } else if(user.equals(role)){
                return "redirect:customersuccess"; 
            }
            return "loginfailure"; 
        }