Loading the application context configuration

The old way to load the application context configuration of our application is to use the web application deployment descriptor file, which is more commonly known as web.xml. However, because we are using the Spring Framework 3.1 in a Servlet 3.0 environment, we can create a web application configuration class by implementing the WebApplicationInitializer interface. This ensures that Spring Framework automatically detects our configuration class when a servlet container is started.

We will use our web application configuration class to:

  1. Load our application context configuration class.
  2. Configure the dispatcher servlet.
  3. Create the context loader listener and add it to our servlet context.

The source code ...

Get Spring Data now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.