Created
March 2, 2014 05:29
-
-
Save sivaprasadreddy/9302357 to your computer and use it in GitHub Desktop.
SpringWebAppInitializer.java with WithSecurity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SpringWebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer | |
{ | |
@Override | |
protected Class<?>[] getRootConfigClasses() | |
{ | |
return new Class<?>[] { AppConfig.class}; | |
//As we have SecurityConfig.java in same package as AppConfig.java and enabled ComponentScan to scan "com.sivalabs.springapp.config" we don't need to explicitely configure it. | |
//otherwise we should add SecurityConfig.class to getRootConfigClasses() | |
//return new Class<?>[] { AppConfig.class, SecurityConfig.class}; | |
} | |
... | |
... | |
@Override | |
protected Filter[] getServletFilters() { | |
return new Filter[]{ | |
new DelegatingFilterProxy("springSecurityFilterChain"), | |
new OpenEntityManagerInViewFilter()}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment