Hi geetha,
you cann't get loginForm object from the request..
You should get it by using @ModelAttribute("loginForm") annotation..
Repalce your loginAction() method with below code..
public
String loginAction(@Valid @ModelAttribute("loginForm") LoginForm login, BindingResult errors) {
///LoginForm login=new LoginForm()----> for this loginform will get null;
System.out.println("<-----loginAction---->"+errors);
boolean status=loginDao.aunthenticateUser(login);
if(errors.hasErrors()){
return "Login";
}
else if(status==false){
errors.rejectValue("userName", "invalid.user");
return "Login";
}
else
return "welcome";
}
In this case, loginForm object from the
jsp page automatically stored into the login object of loginAction() method parameter..