I have a Spring-boot application using Thymeleaf as the view engine and I want to use a folder outside the deployed Jar as the source of the Thymeleaf templates, I set the variable:
spring.thymeleaf.prefix=classpath:/templates/
The "/templates/" is next to the Jar with the HTML files but I get an exception that Thymeleaf cannot resolve the templates, I've tried many configurations like:
spring.thymeleaf.prefix=classpath:templates/
spring.thymeleaf.prefix=classpath:templates
etc, not nothing works. What am I doing wrong, it is even possible?
OK, looks like the way to do it is setting the value using the file url like this:
spring.thymeleaf.prefix=file:./templates/
It Works now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With