Posts

Showing posts with the label MVC

Use of DispatcherServlet in Spring MVC Framework

Image
If you have worked with Spring MVC then you should know   what is a DispatcherServlet?   It's actually the heart of Spring MVC, precisely the C of MVC design pattern or Controller. Every single web request which is supposed to be processed by Spring MVC goes through DispatcherServlet. In general, it's an implementation of Front Controller Pattern which provides a single point of entry in your application. It handles all incoming requests. It is also the bridge between Java and Spring. Btw, the   DispatcherServlet   is like any other Servlet is declared in the web.xml with a URL pattern but the only special thing is that the URL pattern for dispatcher servlet is enough to map every single web request to DispathcherServlert. It is responsible for request handling by delegating requests to additional components of Spring MVC e.g. actual controller classes i.e. those which are annotated using   @Controller   or   @RestController   (in case of RESTful ...