I'm looking for enabling hot refresh of ftl files on spring boot framework, so that changes on ftl files need not require application restart. I had tried following settings through application.properties,
spring.freemarker.cache=false
spring.freemarker.template_update_delay=0
but yet still not getting to it.
How can I enable it through application properties?
thanks!
Freemarker Template Files Spring boot looks for the The template files under classpath:/templates/. And for the file extension, you should name the files with . ftlh suffix since Spring Boot 2.2. If you plan on changing the location or the file extension, you should use the following configurations.
Comments: <#-- and --> Comments are similar to HTML comments, but they are delimited by <#-- and -->. Comments will be ignored by FreeMarker, and will not be written to the output.
FreeMarker is a template engine, written in Java, and maintained by the Apache Foundation. We can use the FreeMarker Template Language, also known as FTL, to generate many text-based formats like web pages, email, or XML files.
FreeMarker is a server-side Java template engine for both web and standalone environments. Templates are written in the FreeMarker Template Language (FTL), which is a simple, specialized language. Note: Spring Boot recently changed the default extension from . ftl to .
I'm using SpringBoot with maven and I have the same problem. I just discovered that the templates are in target/classes/templates so after modifying a template you have to rebuild the project to reinstall the template in classes. This works for me.
Even i faced the same problem. Tried opening in incognito mode. Tried setting browser cache to false. Nothing worked.
Now i copy and paste whatever changes i make to the original ftl to the target folder's ftls
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