}
@RequestMapping(value = "/check")
public String check(User user, ModelMap map,HttpServletRequest request) throws UnsupportedEncodingException {
logger.debug("try to login by {} ",user);
User _user = userManager.loadUserByUsername(user.getUsername());
if (_user == null) {
map.put("flashMsg", "user or password error");
return "user/login";
}
if (!StringUtils.equals(user.getPassword(), _user.getPassword())) {
map.put("flashMsg", "err.password_err");
return "user/login";
}
if (!_user.isEnabled()) {
return "redirect:/user/wait?username=" + URLEncoder.encode(user.getUsername(), "utf-8");
}
return "redirect:/projects";
}