この検証のどこが間違っているのか誰か教えてください。うまくいきません。
@RequestMapping(value="/users", method = RequestMethod.POST)
public String loginForm(@ModelAttribute("users") Users users,
@RequestParam("username") String username,
@RequestParam("password") String password,
Model model,
BindingResult result,Object obj, Errors errors,
final RedirectAttributes redirectAttributes) throws Exception{
if (result.hasErrors()) {
return "loginForm";
}
Users user = pos.varifyUserNameAndPassword(username, password);
if (! user.getUsername().equals(username)) {
return "loginForm";
}
if (! user.getPassword().equals(password)){
return "loginForm";
}
model.addAttribute("users", users);
model.addAttribute("categoryList",pos.listCategory());
redirectAttributes.addFlashAttribute("message2", "Welcome " + username);
return "redirect:/categories";
}
ありがとう