Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. 1) Username
  2. 2) Password
  3. 3) Color
  4.  
  5. @RequestMapping(value = "/users/login", method = RequestMethod.POST)
  6. @ResponseBody
  7. public String handleLogin( @ModelAttribute("user") User paUser,
  8. @ModelAttribute("color") Color paColor,
  9. ModelMap map) {
  10.  
  11. // at this point "paUser" contains both username AND password submitted from form
  12.  
  13. // however, there is nothing in "paColor"
  14.  
  15. ...
  16.  
  17. return "user.jsp"
  18. }
  19.  
  20. @RequestMapping(value = "/users/login", method = RequestMethod.POST)
  21. @ResponseBody
  22. public String handleLogin(UserColorForm form, ModelMap map) {
  23. // now you can work with form.getUsername(), form.getColor() etc.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement