What template engine should I use in Spring MVC?

Sergey Bakotin :

I'm learning Spring MVC and want to create a site. The main problem is a template system. Should I use JSP / JSF / Apache FreeMarker / Thymeleaf or something else?

I saw a lot of discussion on this subject, but they are all outdated. So, I'm curious, what is fine now?

McBeelen :

The best practices for server-side rendering have shifted towards using a template engine. These get the responsibility to merge the data with the template into the actual output.

Current preference appear to be:

JSP's and JSF are entirely different things have become out of fashion.

The big plus for using an actual template engine is that you are forced to separate the concerns of gathering the data to present and rendering the data to present and allow you to (unit) test the templates.

The industry is shifting once more towards client-side rendering, where the server just returns the data as JSON-objects and the web application uses some framework like Angular, React, jQuery or Ember to build the pages.

Note on the edit: riginally the list included Velocity, but that is no longer supported by Spring.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=458595&siteId=1