Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
786 views
in Technique[技术] by (71.8m points)

tomcat - 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?..

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...