Template Engines for Spring Framework

I've taken quite a shine to the Spring Framework and would like to get into it a bit more. I have noticed that aside from plain vanilla JSPs there are various template engines for use with Spring MVC, such as Velocity and Freemarker. Are there others? Which one do you recommend?


I prefer Velocity to Freemarker for the clarity/simplicity of the syntax and professionalism of the community. I also get a lot of mileage out of the VelocityTools library. Freemarker can be a bit more intimidating but is also totally solid. It lacks VelocityTools, but makes up for it with native support for JSP tag libraries.

Either of these template languages is a great improvement over JSP/JSTL, if you ask me.

I am Thymeleaf's author, and I would like to recommend you to have a look it.

Although it is not exclusively SpringMVC-oriented (it can be used without this library), I designed it from the ground up to be a nice replacement for the current view options in Spring MVC: Velocity, Freemarker... and especially JSP.

Thymeleaf is easy to use, elegant, XHTML and HTML5-compatible, extremely extensible, and it allows you to create "Natural Templates", this is, templates that are perfectly browser-displayable pages --great for prototyping!--, as you can see in the "Thymeleaf vs JSP" article already mentioned in other comment.

There is also a comprehensive set of tutorials on the web site, and also some small articles that will help you understand the basics.

Have a look at it, and I honestly think you will never come back to JSP ;-)


Need Your Help

How to compress a processed text file in Python?

python compression

I have a text file which I constantly append data to. When processing is done I need to gzip the file. I tried several options like shutil.make_archive, tarfile, gzip but could not eventually do it...