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

前端 未结 7 1473
闹比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 22:51

    You probably want to make sure to have your directory containing those items set as permitAll.

    Here's an excerpt from my spring security context file. Under the resources directory, I have js, css, and images folders which are given permissions by this line.

    
    

提交回复
热议问题