WebWork decides to go FreeMarker

The sleeping giant WebWork is under heavy development for the next 2.2 version. In fact the first beta is out and can be found here: download WebWork 2.2-b1.
One of the important changes in the next version is the default usage of FreeMarker. This news raised my interest into this framework, so I have spent last night a few moments to see what it is offering.
A very important aspect Patrick pointed about FreeMarker is that the project is still under development, a new version being announced in June. The alternative Velocity doesn’t seem to be in the same state, so from the point of view of an evolving framework this is very important.

I have downloaded the last version 2.3.3 and defined the project under Eclipse. I have noticed that the distribution contains example applications so you should be able to find good references about the usage. It has also an Eclipse plugin, but I haven’t used it so far. A bad thing I have noticed is that the framework is still using some beta libraries, that where not updated to their more stable versions, and this took me a while to make the project compilable in Eclipse.

On the good side, FreeMarker online documentation is very good and covers almost all you need. The flow is very clean and after reading it, you can definitely start using it.

One of the main questions I had after finishing the documentation was how is it different from Velocity? The principles are quite the same and the usage looks very similar. I haven’t seen any big differences from the beginning, but the guys have probably figured this out and they are publishing a comparison here. Some small improvements over Velocity can be considered the built-ins and error handling mechanisms.

The single reason I wouldn’t use this template engine for web applications (the same applies to Velocity, and in a measure to JSP too) is that you are not able to use WYSIWYG editors with your pages. This will increase the time to design the site and will make things harder to customize it. I still believe that the winner in this direction are Tapestry and the growing Wicket (which, by the way, is next on my list [blink/]).

Update: WebWork is already supporting FreeMarker and Velocity, but changed its defaults to FreeMarker. I thought I should mention this for clarification.

6 Comments

Filed under Uncategorized

6 responses to “WebWork decides to go FreeMarker

  1. Jason Carreira

    I think this WYSIWYG argument is a red herring. If you’re using Sitemesh, which I would recommend in nearly all cases, then your whole page won’t be viewable, and the page you’re actually working on will be so simple as to be easily understood. Also, you can componentize your page using WebWork’s component support so each component will be using its own template to render. I can’t see how Tapestry can really show you how things will look if your page is data-driven and may have an unknown number of rows. Anyway, check out FreeMarker with WebWork, not just FM by itself. WebWork sets up a lot of stuff for FreeMarker out of the box and provides data to the templates transparently.

  2. the_mindstorm

    Thanks for your comment Jason. I should confess that I am not as experienced as you are in what regards web applications, but so far my experience tells me that if I keep my pages nearer to an WYSIWYG than a lot of things will be easier to be fixed.
    I am using Sitemesh and I am very happy with it. I am using WebWork and I am very happy with it too [blink/]. Surely, I am gonna try WW with FM. Though, the emerging Wicket is intriguing me and their more clean html is attracting me.
    I don’t usually have problems with my html, but rather with the JS handling html, so in complex cases I keep a clean HTML copy of the expected page just to be able to debug and understand what is going wrong.

    cheers

  3. Cristian Olaru

    Buna! Iti citesc de ceva timp blogul si sunt placut impresionat. Te-am adaugat in lista mea si daca consideri de cuviinta poti sa pui si tu spre mine o referinta: http://olaru.blogspot.com/ . Sunt foarte pasionat de Java, in mod spcial de framework-uri Web, ORM, unelte de dezvoltare, metodologii de dezvoltare. Spor in toate.

  4. Cristian Olaru

    Nu neaparat. In romana imi exprim cel mai bine ideile. Adevarul ca nu stiu prea multi oameni cu avevarat interesati de Java in tara dar (ca sa fiu si mai sincer mai stiu doar 1), sper si cred ca o sa fie.

    Am observat ca, colaborezi la TestNg. Eu inca nu mi-am introdus in obicei sa fac testare automata dar vreau sa fac. Pentru ca simt ca trebuie.

    Momentan lucrez in Bucuresti intr-un proiect (Kepler se cheama firma) si nu prea e timp de teste cu toate ca eu sunt constient ca o retea de teste ar creste productivitatea pe perioada lunga. Plus loc pentru refactoring , etc.

    Nici unde lucram inainte nu faceam unit testing.

    Intrebarea care as vrea sa ti-o pun e: cum pot sa devin test infected. Cum sa fac trecerea spre productivitate pe termen lung. Cum ai reusit tu? Daca pentru tine a fost un pas greu. Mai stiu oameni care incearca asta si care ca si mine nu reusesc din cauza business-ului care trebuie implementat repede.

    Asa vor managerii de proiect. Poate adaugi o intrare in blog cu subiectul asta!

    Spor!

  5. Cristian Olaru

    (…Another example (sorry Cedric) is TestNG…)

    TestNG e tinta BileBlog: http://jroller.com/page/fate?entry=the_black_art_of_good

    Stii de BileBlog – e mai mereu primul blog de pe Jroller.

    Ok.

Leave a reply to Anonymous Cancel reply