Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Spring Security java configuration via @Features

  1. #11
    Join Date
    May 2005
    Location
    BEEK, The Netherlands
    Posts
    231

    Default

    Rob is right this changed to the @Enable annotations.

    So I hope something like @EnableSecurity will be available.

    I think Spring Security could follow the same path like @EnableWebMvc (http://static.springsource.org/sprin...bleWebMvc.html) and it's WebMvcConfigurer/WebMvcConfigurerAdapter to customize bean creations and detail settings. See http://static.springsource.org/sprin...onfigurer.html.

  2. #12

    Default

    Hi,
    Any updates on Java based configuration support for Spring Security?
    Thanks.
    Eugen.

  3. #13
    Join Date
    Jan 2008
    Posts
    1,833

    Default

    See Luke's blog about the scala config project. Note this is not officially supported at the moment, but the blog comments also talk about why java config is not yet supported.
    Rob Winch
    Twitter @rob_winch
    Spring Security Lead
    Spring by Pivotal

  4. #14

    Default

    I've seen the Scala github project, thank you. I was hoping that there was some official word on this, but I understand - the Scala project is as close as we're going to get for now. Thanks for the help.
    Eugen.

  5. #15
    Join Date
    Jan 2012
    Posts
    1

    Default

    Any movement on this? I'm working on a project that is pushing Java Configuration.

    Right now I'm just trying to figure out how to get the DelegatingFilterProxy to recognize the WebApplicationContext

    Code:
       final ServletContextHandler webServletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
       webServletContextHandler.setContextPath(commandLine.getContextPath());
       webServletContextHandler.setClassLoader(Thread.currentThread().getContextClassLoader());
       webServletContextHandler.addServlet(new ServletHolder(new DispatcherServlet(configureSpringApplicationContext(webServletContextHandler, commandLine))), "/*");
          // Do I need to do this??? : 
          //   EnumSet<DispatcherType> dispatcherType = EnumSet.noneOf(DispatcherType.class);
          //   webServletContextHandler.addFilter("org.springframework.web.filter.DelegatingFilterProxy", "/*", dispatcherType);
       webServletContextHandler.addFilter("org.springframework.web.filter.DelegatingFilterProxy", "/*", null);
    And of course get the "No WebApplicationContext found: no ContextLoaderListener registered?"

    Is there a way around this, or am I going to have to load the security XML configuration?

  6. #16

Posting Permissions

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