spring-projects / spring-security

Spring Security
http://spring.io/projects/spring-security
Apache License 2.0
8.81k stars 5.9k forks source link

SEC-2496: Provide documentation explaining how to migrate from XML configuration to JavaConfig configuration #2689

Open spring-projects-issues opened 10 years ago

spring-projects-issues commented 10 years ago

Gerrit Hübbers (Migrated from SEC-2496) said:

I am in the process of migrating my application' usage of Spring Security's XML configuration to JavaConfig configuration.

From my experience, this migration is not trivial, and therefore the Spring Security documentation could have an additional section explaining how to migrate. Questions at StackOverflow seem to support my hypothesis that there is missing documentation.

In my particular case, issues I ran into during migration include:

For a documentation migration section, my idea is to provide a full-fledged XML configuration example, then show a 1:1 corresponding JavaConfig configuration.

Additionally, the documentation could contain subsection for each available Spring Security XML namespace element, and then show the corresponding required JavaConfig-based configuration.

spring-projects-issues commented 10 years ago

Rob Winch said:

Thanks for the feedback abdull. I agree we need better documentation See SEC-2363 A few things that may help your points:

There are currently tests that document the mapping of the XML namespace to the Java Configuration equivalent. They start with Namespace and end in Tests. For example see https://github.com/spring-projects/spring-security/blob/3.2.1.RELEASE/config/src/test/groovy/org/springframework/security/config/annotation/web/configurers/NamespaceRememberMeTests.groovy These mappings should be in the documentation, but in the mean time it should help to know that they exist