Csaba Szegedi wrote:Hello,
I dont understand where is the connection between the controller and view. For instance here is good and short example
http://maestric.com/doc/java/spring/mvc
But, I cant see the connection between
jsp/carList.jsp - list_cars.html
I see the list_cars.html handled by CarListController and what next, how can we arrive at the jsp/carList.jsp ?
Thanks in advance.
The MVC Architecture is
a request comes in. The DispatcherServlet gets it and delegates to a MappingHandler that looks at the URL and determines the Controller and its method to call, it calls it. The Controller returns something or void. This then goes back to the DispatcherServlet that delegates to ViewResolvers to resolve the view to display.
So in your case, the controller returns probably "carList" and in the Spring configuration there is an InternalResourceViewResolver that adds a
string to the front of "carList" hence, "jsp/" and appends ".jsp" to the end of "carList.
Hope that helps
Mark