I am trying to implement Spring-Security 4 into my Spring MVC web and rest app. I added 2 classes to enable Spring Security the java config way. I still want to hold onto
Assuming what you want is to get Spring Security Java Config working with only 2 classes SecurityConfig
and SecurityWebApplicationInitializer
, you need to do the following to get it working. Please note that I am assuming that your spring mvc configuration is still XML. Please note that com.mkyong.web.config
package will have the SecurityConfig
class. This will ensure that the web context will have your security configuration available.
Web.xml as follows
contextClass
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
contextConfigLocation
com.mkyong.web.config
org.springframework.web.context.ContextLoaderListener