Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring MVC with Thymeleaf. Update static data

I'm using Spring MVC with Thymeleaf and Tomcat and I want to be able update static data (html pages) without redeploy. In my application html is mapping by Spring controller. Even JRebel doesn't helps. It updates java classes great, but does nothing with view. What should I do to solve this issue? Maybe for html I need some listener mechanism like Jasper for JSP, or maybe I should disable some cache for Spring controller?..

like image 285
Maxim Kolesnikov Avatar asked Feb 02 '13 05:02

Maxim Kolesnikov


1 Answers

This actually was Thymeleaf issue. I just had to disable caching for templateResolver, which is ON by default.

<bean id="templateResolver" class="org.thymeleaf.templateresolver.ServletContextTemplateResolver">
    <property name="prefix" value="/" /> 
    <property name="suffix" value=".html" /> 
    <property name="templateMode" value="HTML5" /> 
    <property name="cacheable" value="false"/>
</bean>
like image 170
Maxim Kolesnikov Avatar answered Oct 22 '22 11:10

Maxim Kolesnikov