Spring's web MVC framework is, a request-driven web MVC framework, designed around a servlet that dispatches requests to controllers and offers many other functionality for the development of web applications. Spring's DispatcherServlet is completely integrated with the Spring ApplicationContext and allows you to use every other feature of springs as well.
Following steps are needed to Configure Dispatcher Servlet for a Spring Application (Assuming Tomcat as Web Container)
<servlet> <servlet-name>springexp</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springexp</servlet-name> <url-pattern>*.htm</url-pattern> </servlet-mapping>
After inserting these lines any URL with an ‘htm’ extension will be routed to the 'springapp' dispatcher.