Link Details

Link 55385 thumbnail
User 111696 avatar

By bloid
via javaworld.com
Published: Dec 03 2007 / 03:18

Template engines can be applied to a wide variety of development scenarios where you want to generate text based on specific processing rules, and are often used as the view component in MVC applications. In this article, Jeroen van Bergen explains where template engines fit into your application architecture and shows you some of the operations common to all template engines. Finally, he compares the two leading Java template engines, Velocity and FreeMarker, in terms of power, ease of use, and performance.
  • 8
  • 2
  • 1324
  • 493

Comments

Add your comment
User 108814 avatar

aj16780 replied ago:

0 votes Vote down Vote up Reply

Freemarker should always be preferred over Velocity. Just look at their source codes.

User 191349 avatar

raveman replied ago:

0 votes Vote down Vote up Reply

Velocity is like log4j, old school. It should be deprecated, but its not. I didnt know that Freemarker has that much better preformance. I think that autor didnt say strong enought that when you use Velocity you need to manually test is it works ok(for every possible combination).

its just like
try {
// code
} catch (Exception e){
}

compared to

try {
// code
} catch (Exception e){
throw new RuntimeException(e);
}

User 204981 avatar

reido56 replied ago:

0 votes Vote down Vote up Reply

I prefer FreeMarker because of its error handling. For me, the usefulness of a template engine drastically lowers if I need to spend time puzzling over what's going on.

User 191349 avatar

raveman replied ago:

0 votes Vote down Vote up Reply

ps. i just found funny that author suggest that Velocity is the best
"Jeroen van Bergen started working in information technology in 1993. He has worked in the fields of billing, systems integration, and order management in the telecommunication industry. He has been programming in Java since 2000. Jeroen is at the moment mainly interested in workflow, Java-XML binding, and automatic document generation using Velocity and XSL:FO."

he knows all of them and hes using Velocity :D lazy guy, but Freemarker is not that hard to learn(Its almost the same). But some people when they get used to some technology cant leave it behind.

User 187417 avatar

sproketboy replied ago:

0 votes Vote down Vote up Reply

I've been using Velocity for quite a while. I haven't seen any reason to use FreeMarker.

User 167411 avatar

rolfst replied ago:

0 votes Vote down Vote up Reply

the author should have mentioned some about documentation like velocity doesn't have any that matters.

User 187417 avatar

sproketboy replied ago:

0 votes Vote down Vote up Reply
User 260918 avatar

revusky replied ago:

0 votes Vote down Vote up Reply

There is a response to the article on the FreeMarker group blog. http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html
,There is a response to the article on the FreeMarker group blog. http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (8)



Voters Against This Link (2)