Spring security does not allow CSS or JS resources to be loaded

前端 未结 7 1405
闹比i
闹比i 2020-11-29 22:45

The resource is under src/main/resources/static/css or src/main/resources/static/js, I\'m using spring boot, and the class of security is:

@Configuration
@En         


        
相关标签:
7条回答
  • 2020-11-29 23:03

    Add following

    @Override
        public void configure(WebSecurity web) throws Exception {
            web.ignoring().antMatchers("/resources/**").anyRequest();
        }
    
    0 讨论(0)
提交回复
热议问题