Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1) Username
- 2) Password
- 3) Color
- @RequestMapping(value = "/users/login", method = RequestMethod.POST)
- @ResponseBody
- public String handleLogin( @ModelAttribute("user") User paUser,
- @ModelAttribute("color") Color paColor,
- ModelMap map) {
- // at this point "paUser" contains both username AND password submitted from form
- // however, there is nothing in "paColor"
- ...
- return "user.jsp"
- }
- @RequestMapping(value = "/users/login", method = RequestMethod.POST)
- @ResponseBody
- public String handleLogin(UserColorForm form, ModelMap map) {
- // now you can work with form.getUsername(), form.getColor() etc.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement