I've read that adding @modelAttribute in method param binds the incoming data to the object and add it to the model object as attribute.
@RequestMapping(value = "/list", method = RequestMethod.GET) public String list(@ModelAttribute User user) { return "list"; } if this is accessed via /list?name=unnamed, in list.jsp "unnamed" can be seen using {user.name} because it was added as model attribute for list.jsp. This is very clear to me.
But if i do
@RequestMapping(value = "/list", method = RequestMethod.GET) public String list(User user) { return "list"; } "unnamed" can still be seen using {user.name} when accessed via /list?name=unnamed. I thought the user object will not be added into model because it does not have @ModelAttribute annotation.
@ModelAttributeannotated argument don't apply then.