Changes made to Thymeleaf HTML template not reflected on browser refresh
When I took the sample thymeleaf vs jsp sample app for a spin I noticed the above problem.
The jsp template has no problem, all the changes are picked on browser refresh.
Is there a way to solve this issue?
To verify this issue, just edit this line in subscribeth.html
This is because Thymeleaf has a parsed template cache which is active by default, so it is not reading your template from disk every time you refresh your page on the browser. JSP doesn't have this cache - instead tomcat detects every modification you do on your JSP and recompiles its corresponding servlet when such modification occurs.
If you want your template file to be read every time from disk, you have several options:
1. Disable the cache setting its size to 0.
2. Set the TTL for your template (at the template resolver) to 0ms.
3. Set your specific template as non-cacheable (at the template resolver, too).