Configuring the Spring application context

Traditionally, we would use declarative configuration with XML configuration files, but after Spring Framework 3.0 was released, it has been possible to configure the Spring application context by using programmatic configuration. This is our weapon of choice when we are configuring the application context of our application.

We can configure the Spring application context by following these steps:

  1. Create a properties file for the values of the configuration parameters.
  2. Create the application context configuration class.

Creating the properties file

The actual values of the configuration parameters are stored in a properties file called application.properties. This file contains database connection details, ...

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.