【发布时间】:2016-03-10 03:15:13
【问题描述】:
我已经尝试配置 Spring Security。
这是我的安全配置。
@Override
protected void configure(HttpSecurity http) throws Exception {
// @formatter:off
http.authorizeRequests()
.antMatchers("/api/**", "/denied**").permitAll()
.anyRequest().denyAll()
.and()
.exceptionHandling().accessDeniedPage("/denied")
.and()
.csrf().disable();
// @formatter:on
}
当我访问 url "localhost:8080/admin" 时,我期待 "/denied" 页面。 但它显示默认的 403 页面提供了 spring 安全性。 我的配置有问题吗?
【问题讨论】: