Migrating from JSP to Thymeleaf. One part at a time

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Migrating from JSP to Thymeleaf. One part at a time

sagargaikwad
Hi,
     I am replacing JSP code in my web pages with thymeleaf. I am using Spring MVC. I want to know that, is there any way that I can do this transformation part by part? So web page will contain one part with JSP code and other part with thymeleaf code. Is it possible?
Reply | Threaded
Open this post in threaded view
|

Re: Migrating from JSP to Thymeleaf. One part at a time

danielfernandez
Administrator
Currently, you can mix JSP and Thymeleaf fragments in the same page by using Apache Tiles (see https://github.com/thymeleaf/thymeleaf-extras-tiles2 ), but there is no direct way to mix them if you don't use Tiles.

Nevertheless, I've created this as task for future versions https://github.com/thymeleaf/thymeleaf/issues/40 because I think it would be a nice addition. Follow that issue if you want to be kept up-to-date with this future JSP-Thymeleaf integration module.

Anyway, remember that mixing JSP pages and Thymeleaf pages in the same application is already possible just by defining two View Resolvers (one for JSP, another one for Thymeleaf. See the "Thymeleaf vs JSP" example application at http://www.thymeleaf.org/documentation.html). But this will not allow you to mix JSP and Thymeleaf fragments in the same page... just have JSP complete pages and Thymeleaf complete pages, all in the same application.

Regards,
Daniel.
Reply | Threaded
Open this post in threaded view
|

Re: Migrating from JSP to Thymeleaf. One part at a time

sagargaikwad
I tried <jsp:include="/WEB-INF/jsps/xyz"> where request xyz is mapped to thyme based page and it seems to be working for me.