I know that there are similar questions on this subject, but I can't seem to find a solution. I have a Spring MVC project and the problem is that I get the error specified in the title in the browser log when I run the app. If I open the index.html in browse (not from Spring) the CSS is loaded.
index.html CSS declaration
<link rel="stylesheet" type="text/css" th:href="@{ /css/index.css }"
href="../../resources/static/css/index.css">
Controller
@RequestMapping(value = { "/", "/index"}, method = RequestMethod.GET)
public ModelAndView index() {
ModelAndView model = new ModelAndView();
model.setViewName("index");
return model;
}
I even tried to add this in the SecurityConfiguration
@Override
public void configure(WebSecurity web) throws Exception {
super.configure(web);
web.ignoring().antMatchers("/resources/**", "/static/**", "/css/**", "/icons/**", "/javascript/**");
}
but it doesn't work.
The path is good because as I said when I open the index.html in browser the CSS is loaded, I think that the problem is with the SecurityConfiguration class, but I don't know what it is.
Does anyone have any idea?