Spring Security configuration

To add Spring Security to our Spring web application, we need to perform a basic Spring Security setup. To do this, follow these steps:

  1. Add Spring JARs or Spring Security dependencies.
  2. Update web.xml with springSecurityFilterChain.
  3. Create a Spring Security configuration file.

Spring Security setup

We can either download and add Spring Security JARs to classpath or we can provide dependencies to Maven.

Adding JARs to the classpath

There are three important JARs that we need for Spring Security. These can be downloaded from the Spring website and are as follows (the version should match other Spring JARs used in the project):

  • spring-security-config-3.X.X.RELEASE.jars: This contains support for Spring Security's XML namespace ...

Get Spring: Developing Java Applications for the Enterprise 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.