I am new to spring frame work and spring boot.I am trying to add the static html file with CSS,javascript,js. the file structure is
I'm new to spring boot too and I have the same problem. I have put the correct path manually into the browser and have seen the 404 by tomcat. Then I have found a solution at: Spring-Boot ResourceLocations not adding the css file resulting in 404
Now the css file is accessible by code.
You must move the css folder to src/main/resources/static/css then the content is readable (at my local configuration).
I hope it works at your configuration too.
This is what worked for me after many attempts:
/resources/static/css/stylesheet.css
th:href="@{/css/stylesheet.css}"
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/css/**");
}