I am new to Spring MVC and went thru some tutorials on net.
Came across below code in one of handler class under my project.
When form is submitted for action userHistory , call goes to my below handler method
@RequestMapping(value="/userHistory", method=RequestMethod.GET) public @ResponseBody UserDetails getUserHistory(Model model, HttpServletRequest request, HttpServletResponse response) { model.addAttribute("userDetail", new userDetail()); } Does DispatcherServlet construct empty Model object and pass to handler method getUserHistory?
Similarly when i submit for action "/userDetail" from my jsp, i get method parameter "userDetail" object filled with required data.
@RequestMapping(value="/userDetail", method=RequestMethod.POST) public String userDetail(UserDetail userDetail, HttpServletRequest request, HttpServletResponse response, Locale locale) {} Is DispatcherServlet doing this or some other interceptor?
UPDATE:- JSP code snippet is
<form:form id="userForm" action="path/userDetail" method="post" commandName="userDetail">