Results 1 to 2 of 2

Thread: Use of Spring XML namespace with JavaConfig

  1. #1
    Join Date
    Oct 2010
    Posts
    1

    Default Use of Spring XML namespace with JavaConfig

    Hi all,

    Is it possible to use Spring XML namespaces with JavaConfig right now?
    Something like this (spring security namespace) would be really cool to do:
    Code:
    @Configuration
    public class SecurityConfig {
    
    	@Http(autoConfig=true, accessDeniedPage="/login.html", children= {
    		interceptUrl(pattern="/secure/**", access="ROLE_USER"),
    		interceptUrl(pattern="/**", access="IS_AUTHENTICATED_ANONYMOUSLY"),
    		formLogin(authenticationFailureUrl="/login.html", defaultTargetUrl="/index.html", loginPage="login.html")
    	})	
    	Object http() {
    		return null;
    	}
    }
    These annotations should be very easy to intercept and interpret with AOP and the appropriate Builder.
    No needs to parse XML anymore which means that bean definition parsers and bean definitions would be not required anymore. Huge improvement!

  2. #2
    Join Date
    Sep 2006
    Location
    Hartford, CT
    Posts
    145

    Default

    This capability doesn't currently exist, but according to a presentation I saw at SpringOne last week, such a feature is being more-or-less "incubated" in 3.1. Don't expect support for all custom config namespaces to be used in this fashion out of the box, but I got the sense that it is indeed on the horizon.
    Kent Rancourt
    DevOps Engineer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •