This chapter discussed how to use Spring in web applications. We started with a quick overview of the MVC pattern. Our discussion continued with the common configuration to integrate web frameworks with Spring. We used the
org.springframework.web.context.ContextLoaderListener class to load the Spring application context at application startup, and then store it in the
ServletContext. In any JSP page or servlet class, the stored
ApplicationContext can be accessed through Spring utility class:
To develop a web application with the Spring MVC framework, you must configure the
DispatcherServlet as the front controller.
DispatcherServlet accepts all web requests, and forwards each to ...