I have the following file structure:
the MvcWebConfig
file has this:
@Configuration
public class MvcWebConfig implements WebMvcConfigurer {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**")
.addResourceLocations("/public", "classpath:/static/")
.setCachePeriod(31556926);
}
}
as read here that @EnableWebMVC
shouldn't be used.
I've tried this in my HTML (which is placed in the templates folder)
<link rel="stylesheet" href="/static/css/bootstrap.min.css">
<link rel="stylesheet" href="static/css/bootstrap.min.css">
<link rel="stylesheet" href="resources/static/css/bootstrap.min.css">
<link rel="stylesheet" href="/resources/static/css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="/css/bootstrap.min.css">
but none of these worked.
What am I doing wrong? I'm using Spring 5