In controller class, write a function for your login page:
public String anyController(your defined
parameters ....){
Authentication auth =
SecurityContextHolder.getContext().getAuthentication();
if (!(auth instanceof AnonymousAuthenticationToken)) {
/* The user is logged in :) */
return new ModelAndView("forward:/index");
}
//
write your other code here
return "";
}
No comments:
Post a Comment