Which Java templating system should I use to generate emails?
java, jsp, spring, templating, velocity
Solution
You should go with Velocity. It's easy to learn and has a low dependency and implementation footprint, especially when using Spring.
But, if it's just one Use Case, you should stick with the String and unless you have no time for experiments ;)
Problem
I have a website that uses JSP as its view technology (and Spring MVC underneath). Unfortunately, JSP is just a pain to use for anything that doesn't involve an HTTP session. I would like to be able to occasionally send my users some email, and I want to use something JSP-like to render the email's contents. Technologies I'm aware of include: - JSP -- It can be forced to work for this sort of thing, I think. Very worst case, I could request the page from my own webserver and render that into an email (ugh!) - Velocity -- I've heard good things about this one, and am leaning towards it. - StringTemplate -- Looks okay, but I'm worried that no new releases have come out in a year. Is there a preferred technology for templating in a Java system? Would folks generally recommend Velocity? Is there a good way to use JSP for more generic tasks?