Thymeleaf VS Summer

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

Thymeleaf VS Summer

CWayman
This post was updated on .
Hi,

Thymeleaf popped up on my RSS feeds this morning and looks very interesting so I thought I would come over and ask a few questions if I may:

1) I have been looking at an HTML5 templating engine to start using in a Spring MVC app.  So far I have come across thymeleaf and another called Summer. (http://www.asual.com/summer/)

I was wondering if anyone had any opinions between the two?

2) I've also been looking at integrating Spring WebFlow and Primefaces into my app as per their application showcase (http://static.springsource.org/spring-webflow/docs/2.3.x/reference/htmlsingle/spring-webflow-reference.html#whatsnew).

Can anyone see any issues with these technologies with thymeleaf?

3) I am also looking at deploying my application onto the google app engine which means that all classes used must be serializable.  I haven't downloaded the thymeleaf source yet but I was wondering if there would be any issues with this?

Very well written documentation too I must say.  It was very easy to learn how to get up to speed and start coding in thymeleaf, a big plus point in my book.

Thanks in advance.
Craig.
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf VS Summer

Zemi
Administrator
> So far I have come across thymeleaf and another called Summer. (http://www.asual.com/summer/)
> I was wondering if anyone had any opinions between the two?

The syntax is similar, Summer use HTML5 data-* attributes, like
    <div data-repeat="${someList}">
while Thymeleaf use HTML attributes with some namespace, like
    <div th:each="value : ${someList}">

Thymeleaf is a generic template engine, while Summer is focused in concrete utilities (AJAX, validation...).

In Thymeleaf, you could achieve validation, AJAX... utilities implementing custom dialects (a dialect is like a JSP tag library) or using a third-party dialect.

Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf VS Summer

Zemi
Administrator
In reply to this post by CWayman
> I've also been looking at integrating Spring WebFlow and Primefaces
> Can anyone see any issues with these technologies with thymeleaf?

Thymeleaf philosophy tries to keep templates as pure HTML, while JSF is very intrusive with HTML
   https://src.springframework.org/svn/spring-samples/webflow-primefaces-showcase/src/main/webapp/WEB-INF/layouts/standard.xhtml
so I don't see the point on mixing Thymeleaf and JSF.

Disclaimer: I'm a user of Thymeleaf, so this is not an official statement.
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf VS Summer

Zemi
Administrator
In reply to this post by CWayman
> I am also looking at deploying my application onto the google app engine

Thymeleaf "should" work with GAE because nothing is Thymeleaf code is incompatible with GAE, but at this time it has not been tried.
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf VS Summer

CWayman
Thanks for your responses.

I was hoping to use PrimeFaces as I quite like the look of their widgets.  I think however based on that I'm probably going to take a look at jQuery, this will keep it much more aligned to html and javascript based with Spring MVC / WebFlow for the controllers.

This should provide me the ajax-validation that Summer provides.  I do like the look of thymeleaf a lot more than summer.  Well... there is just documentation for it!

One thing I have been wondering with having the natural templating and jQuery is that if I have a data table with an HTML table was it's source, the browser should be able to render the jQuery in the natural template.  It would be amazing to edit jQuery CSS and see the results on the fly.  I still need to test it out, but after deploying JSF apps for years having natural templating seems like something I could never live without now.

Craig.
Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf VS Summer

Zemi
Administrator
> I do like the look of thymeleaf a lot more than summer.

I have been using Thymeleaf for the last two months and I am fully satisfied with it.

> This should provide me the ajax-validation that Summer provides.

I have developed a thymeleaf custom dialect to integrate jquery-validation-plugin. It is by no means a completed work, but I could share it if you are interested.

Reply | Threaded
Open this post in threaded view
|

Re: Thymeleaf VS Summer

danielfernandez
Administrator
In reply to this post by CWayman
Hi,

To be honest, I don't know Summer, so I cannot tell about real differences between it and Thymeleaf... but it looks interesting, so I'll certainly keep an eye on it.

As for Google App Engine, as far as I can remember it doesn't require that all classes are Serializable. It does though impose some limitations on your code like: 1. Only using "whitelisted" java classes (which thymeleaf does), 2. Not creating your own threads (which Thymeleaf does not create), 3. Not trying to directly access the filesystem (which Thymeleaf does not try if you use servletcontext and/or classloader template resolvers), 4. etc.

This said, I haven't tested thymeleaf at GAE yet -- though it is in my To-Do --, so I cannot give you a 100% certain answer. All I can say for now is it *should* work OK.

Think however that GAE punishes framework initialization time because it doesn't guarantee you that your server instance will be around for too long (it's continuously starting and stopping instances), so the less initialization a library needs to do on its first run, the better... and thymeleaf needs some initialization (some internal structures are created the first time a template is processed). This isn't a huge amount of time... but it's something to think about (btw, you might be able to execute this initialization faster if you set log level to >= WARN).

Also, think that if GAE recycles instances continuously, your parsed template cache will not be of much use... it will certainly help while the instance is alive, but of course it will have less impact on performance than on a "normal" server.

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

Re: Thymeleaf VS Summer

marceloverdijk
Today I deployed a (very) basic Spring 3 / Tiles 2 / Thymeleaf application to GAE with success.
It must be sait that it only included 1 simple page and a layout.

Next year we probably evolve this application with the current setup (replacing jsp).