相关疑难解决方法(0)

在WebSecurityConfigurerAdapter中正确使用WebSecurity

在基于版本1.3.0.BUILD-SNAPSHOT的Spring Boot应用程序中,我在下面的文件夹中有静态资源(images,css,js).staticresources

我看到一些与安全配置相关的示例,如下所示:

@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    public void configure(final WebSecurity web) throws Exception {
        web.ignoring()
           .antMatchers("/static/**");
    }
}
Run Code Online (Sandbox Code Playgroud)

这个例子是否正确?应该是什么影响?如何验证它是否有效(例如,请求localhost:8080/something?我可以做些什么很酷的事情WebSecurity

java security spring spring-boot

12
推荐指数
1
解决办法
3万
查看次数

标签 统计

java ×1

security ×1

spring ×1

spring-boot ×1