我正在使用Spring-boot项目。我把jsp文件放在了位置下
WEB-INF/views/
。我添加了spring安全配置,并apache-tiles
添加了ViewResolver
。每次运行项目时,我都会看到很多Spring-Security的过滤器调试日志拦截了我的jsp文件
DEBUG AntPathRequestMatcher:157 Checking match of request : '/WEB-INF/views/home.jsp'; against '/css/**'
DEBUG AntPathRequestMatcher:157 Checking match of request : '/WEB-INF/views/home.jsp'; against '/js/**'
DEBUG AntPathRequestMatcher:157 Checking match of request : '/WEB-INF/views/home.jsp'; against '/images/**'
DEBUG AntPathRequestMatcher:157 Checking match of request : '/WEB-INF/views/home.jsp'; against '/webjars/**'
DEBUG AntPathRequestMatcher:157 Checking match of request : '/WEB-INF/views/home.jsp'; against '/**/favicon.ico'
DEBUG FilterChainProxy:325 /WEB-INF/views/home.jsp at position 1 of 15 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
DEBUG FilterChainProxy:325 /WEB-INF/views/home.jsp at position 2 of 15 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
DEBUG FilterChainProxy:325 /WEB-INF/views/home.jsp at position 3 of 15 in additional filter chain; firing Filter: 'HeaderWriterFilter'
DEBUG FilterChainProxy:325 /WEB-INF/views/home.jsp at position 4 of 15 in additional filter chain; firing Filter: 'CsrfFilter'
DEBUG FilterChainProxy:325 /WEB-INF/views/home.jsp at position 5 of 15 in additional filter chain; firing Filter: ''
DEBUG FilterChainProxy:325 /WEB-INF/views/home.jsp at position 6 of 15 in additional filter chain; firing Filter: 'LogoutFilter'
DEBUG FilterChainProxy:325 /WEB-INF/views/home.jsp at position 8 of 15 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
DEBUG FilterChainProxy:325 /WEB-INF/views/home.jsp at position 9 of 15 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
DEBUG FilterChainProxy:325 /WEB-INF/views/home.jsp at position 10 of 15 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
我不确定问题Are those normal things ?
。我想通过在should I ignore them
课程中添加以下代码来了解SecurityConfig
。
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("**/*.jsp");
}