0

What i know is that when using spring security with spring boot, the css and js file are loaded automatically from static/css and static/js folders respectively. In my case i am using a "ready to use" angular js template for front end in which the js file are not placed in a /js folder (download and see SB ADMIN ANGULAR) which means that i will have to modify the template's composition sothat it contains /js and /css folders that hold the .css and .js files enter image description here

Is there any way to avoid that modification ? Is it possible to configure Spring boot in a way it becomes able to load .js and .css ? thank you.

1 Answers1

0

There are two aspects here: one is the ability of Spring Boot to serve static resources from a certain, custom location of your choice -- for that you can find and answer here.

The second aspect is being able to pass said resources through the Spring Security filter -- for that, you can see this discussion, the relevant code being:

.antMatchers("/","/public/**", "/resources/**","/resources/public/**")
                .permitAll()
Community
  • 1
  • 1
Deroude
  • 1,052
  • 9
  • 24