I have the same problem as mentioned in no mapping for GET but didn't work for me.
this is the structure : resource structure in my project
and this is my config class :
@Configuration
@EnableWebMvc
public class MvcConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry
.addResourceHandler("/resources/**")
.addResourceLocations("/resources/");
}
}
and this is my controller:
@RequestMapping("/")
public ModelAndView getHomepage() {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("home.html");
return modelAndView;
}
and I have this in my html file:
<link rel="stylesheet" href="/css/home.css" />
but still get the error: No mapping for GET /css/home.css No mapping for GET /js/home.js
would be appreciated for any suggestions thank you