r/SpringBoot • • Mar 24 '26

Question Thymeleaf template storage. Best practive

Hi everyone,

By default, spring boot bundle the thymeleaf templates within the jar file. This mean that when you have to edit the html or the css file, you have to compile and repackage the whole app.

It feel like this defy the purpose of html, css in the first place.

I find myself moving more and more toward external html and css.

Is there any good reason not to do that by default?

5 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/-rcgomeza- Mar 24 '26

You wouldn't track it in the database. I think it creates more problems.

3

u/MartinPeterBauer Mar 24 '26

Why not? It gives customer the posibility to customize their report and email templates without a deployment.

Thats not a bad thing

1

u/-rcgomeza- Mar 24 '26

Makes sense if templates are user owned. In that case they’re data, not code, so DB storage is reasonable 👍.

But for app templates: no versioning, harder debugging, risk of breaking rendering in production, less testeability etc.