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

前端 未结 7 1472
闹比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();
        }
    

提交回复
热议问题