I have been doing the project since spring MVC and Thymeleaf. I have a question about how I should link to my CSS files if I have this folder structure:
src main webapp resources myCssFolder myCssFile.css web-inf spring views myViewFolder index.html
My configuration class looks like this:
@Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/css/**").addResourceLocations("/css/**"); registry.addResourceHandler("/img/**").addResourceLocations("/img/**"); registry.addResourceHandler("/js/**").addResourceLocations("/js/**"); registry.addResourceHandler("/sound/**").addResourceLocations("/sound/**"); registry.addResourceHandler("/fonts/**").addResourceLocations("/fonts/**"); }
And I call href in my index file as follows:
href="resources/css/bootstrap.min.css"
But there are some elements that are confused on my page, for example, CSS does not work.
source share