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
For some reason, this did not work for me:
http.authorizeRequests().antMatchers("/resources/**").permitAll();
I had to add this:
http.authorizeRequests().antMatchers("/resources/**").permitAll().anyRequest().permitAll();
Also, this line has to be after the code which restrics access.