Pregunta

I've been using JSP/JSTL for a long time with Netbeans and Tomcat, but now I'm tired of the silly template engine, so I decided to try Thymeleaf. It works just fine so far, but whenever I save a Thymeleaf template, I need to redeploy my application for the template to update.

How do I make Netbeans automatically update the deployed template file when I save it?

(I couldn't add the "thymeleaf" tag because I have too few points.)

¿Fue útil?

Solución

It seems to help when I disable caching of the template resolver.

Add this property to the template resolver bean:

<property name="cacheable" value="false" />

Otros consejos

Thymeleaf template resolvers cache parsed templates by default, in order to improve performance. Note this parsing only applies to templates themselves and not the data used for processing them.

As you say, you need to turn the cacheable property in the template resolver (TemplateResolver.java) to false if you want Thymeleaf to re-read your template every time it is processed:

<property name="cacheable" value="false" />
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top