gpt4 book ai didi

java - @EnableWebSecurity 和 @EnableWebMvcSecurity 有什么区别?

转载 作者:IT老高 更新时间:2023-10-28 13:03:35 26 4
gpt4 key购买 nike

@EnableWebSecurity

JavaDoc 文档:

Add this annotation to an @Configuration class to have the Spring Security configuration defined in any WebSecurityConfigurer or more likely by extending the WebSecurityConfigurerAdapter base class and overriding individual methods.

@EnableWebMvcSecurity

JavaDoc 文档:

Add this annotation to an @Configuration class to have the Spring Security configuration integrate with Spring MVC.

  • 与 Spring MVC 集成”究竟意味着什么?我会得到哪些额外的行为?
  • 我找到了 guides & answers ,这表明此注解将 CSRF Tokens 添加到 Spring MVC 表单中,这是它唯一添加的吗?

最佳答案

As of Spring Security 4.0, @EnableWebMvcSecurity is deprecated. The replacement is @EnableWebSecurity which will determine adding the Spring MVC features based upon the classpath.

To enable Spring Security integration with Spring MVC add the @EnableWebSecurity annotation to your configuration.

source

关于java - @EnableWebSecurity 和 @EnableWebMvcSecurity 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27906161/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com