I've been trying to utilise Thymeleaf in a web that I'm playing with and can't quite seem to get my head around the configuration / setup.
Previously I've used the web folder for storage of assets and jsp/html etc but this now seems to be redundant as the views folder has moved to resources. Is this accurate?
My structure looks something like this:
src-main-java-various controllers/models etc
src-main-resources-Meta-inf - persistence.xml
src-main-resources-spring-config.xml
src-main-resources-views-test.html etc etc
src-main-webapp-assets-css - now in the wrong place?
src-main-webapp-WEB-INF-html/jsp = now irrelevant?
Apologies if this seems like a dumb question, I can't seem to find a decent tutorial that doesn't have conflicting information in it.
I'm basically trying to set up a simple web application using thyme leaf instead of jsp files. Any pointers in the right direction are gratefully received.
Thus far I have a ConfigClass containing
@Bean
public ViewResolver viewResolver() {
ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver();
templateResolver.setTemplateMode("XHTML");
templateResolver.setPrefix("views/");
templateResolver.setSuffix(".html");
SpringTemplateEngine engine = new SpringTemplateEngine();
engine.setTemplateResolver(templateResolver);
ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
viewResolver.setTemplateEngine(engine);
return viewResolver;
}
which seems to be the key behind everything but as it's from a tutorial I'm not sure what is good/bad/incorrect/bad practice and so on.