Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thymeleaf vs Tiles

I plan to port a MVC app from Spring 3 to Spring 4 using Spring Boot.

This webapp use Apache Tiles.

I'm a bit confused considering Thymeleaf seems to be the new standard with Spring, with nice integration.

Tiles was a pain to configure in this app.

We've got like 20 JSP pages in this app.

Questions :

  • Does Thymeleaf and Tiles are similar concepts ? (template engine ?)
  • I've seen that Thymeleaf could be used with Tiles... I can't see how and why
  • Would it be better to keep Tiles and make it working with a Spring 4 / Boot application ?
  • Would it be better to port Tiles/JSP to Thymeleaf templates ?
like image 912
Barium Scoorge Avatar asked Oct 07 '15 09:10

Barium Scoorge


People also ask

Is Thymeleaf still relevant?

While Thymeleaf is more of a template engine for server-side application development. But Thymeleaf's popularity is on a steady rise. The developer community is slowly moving away from 'once a common' MVC framework for Javascript-based development.

Is Thymeleaf better than JSP?

If you are building web front-ends with Spring Boot or Spring MVC, and you're still using JSP (Java Server Pages) then this course is for you. Thymeleaf is a great templating engine which replaces JSP, and you can easily use it in any Spring MVC or Spring Boot application. Unlike JSP it's a pleasure to use.

Is Thymeleaf necessary?

No they aren't necessary, in fact most new projects that require web-pages are using single page applications now like Angular, React, Vue, ... over thymeleaf or jsp.

Should I use Thymeleaf or react?

Both technologies are completely different. React provides so much, however Thymeleaf is just a template rendering library. If you want to make career in FE then learn React/Angular/Vue.. if you just want to build a crud with minimal learning curve then only go for Thymeleaf.


1 Answers

I would suggest eventually porting Tiles to Thymeleaf, but you don't have to do it all at once.

Your intermediate strategy could be to start using layouts and integrating existing Tiles where it makes sense. New development can be straight Thymeleaf and you can fully port existing Tiles when it makes sense to you.

Please see the following article (you can jump to the "Thymeleaf Tiles Integration" section) and the associated example code on github.

like image 101
Michael Kowalski Avatar answered Nov 03 '22 16:11

Michael Kowalski