InterviewSolution
Saved Bookmarks
| 1. |
How does the Spring MVC flow look like? In other words, How does a DispatcherServlet know what Controller needs to be called when there is an incoming request to the Spring MVC? |
|
Answer» A Dispatcher Servlet knows which controller to call by means of handler mappings. These mappings have the mapping between the controller and the requests. BeanNameUrlHandlerMapping and SimpleUrlHandlerMapping are the two most commonly USED handler mappings.
If the Spring MVC is CONFIGURED using annotations, then @RequestMapping annotations are used for this purpose. The @RequestMapping ANNOTATION is configured by making use of the URI path, HTTP METHODS, query parameters, and the HTTP Headers. |
|