Groovy Templating vs. Velocity

Maybe this comparison is unfair, since the Groovy Templating mechanisms are relatively new and velocity has been around for years, but still, I did round into some troubles and just wanted to give some advice.

I have a grails application that needed to dynamically create some files using templates.  I initially when the Groovy template route, but soon came into limitations, namely, my templates were ant build files, other applicaition type of files that went beyond the regular string substitution that templates provide.  I switched my template processing to use velocity and everything is running beautifully. 

Nothing at all is wrong with the Groovy Templating, it's just for your simplest cases, like a customer order email where there is no other markup besides your variables,  If you need anything more advanced than that, you need to use velocity, webmacro and friends.

 

 

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options