2
I’m creating a project with Springboot and Thymeleaf. I set up the whole project, I find the template and the pages, so my template can’t find the files css and js;
Html
<link rel="stylesheet" th:href="@{/bootstrap/css/bootstrap.min.css}"/>
application properties
# --- CONFIGURAÇÃO TYMELEAF ---
spring.thymeleaf.suffix=.html
spring.thymeleaf.mode=HTML5
spring.thymeleaf.cache=false
spring.thymeleaf.content-type=text/html
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.check-template-location=true
spring.thymeleaf.enabled=true
Webmvcconfigureradapter
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/resources/**")
.addResourceLocations("/resources/")
.addResourceLocations("/static/")
.addResourceLocations("/static/**")
.addResourceLocations("/resources/static/")
.addResourceLocations("/resources/static/**")
.addResourceLocations("/")
.addResourceLocations("/**");
}
Folder structure