Spring Security 3.1.3 @EnableWebSecurity

南楼画角 提交于 2020-01-15 03:39:22

问题


I'm having trouble finding which package contains @EnableWebSecurity in Spring Security 3.1.3. I've added core, config, web and ldap security packages, but the annotation remains unavailable. Has it been replaced by another annotation?


回答1:


I think java config support is not yet released with Spring Security, but available as a separate module in spring-security-javaconfig. See instructions in the linked page about how to include the jar into your maven build.




回答2:


I faced the same problem and was able to solve it by adding "spring-boot-starter-security" as a dependency in build.gradle as mentioned in the spring "Getting Started" guide available @ https://spring.io/guides/gs/securing-web/



来源:https://stackoverflow.com/questions/16105844/spring-security-3-1-3-enablewebsecurity

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!