Mark Lowe wrote:
I use Jelly for email templates. So that I can use the same EL language/system I use with JSPs in developing HTML/plain text email templates.Hello
I've been looking at the EL api and I'm wondering if it can be used like folk use velocity, for email templates and such like.
Does EL lend itself well to this? or was it onlt made as something to be parsed and then compiled?
Any wikis to get me going would be appeciated.
Mark
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Found that you can embed Jelly in your code using the following:
ByteArrayOutputStream os = new ByteArrayOutputStream();
Embedded embedded = new Embedded();
embedded.setOutputStream(os);
embedded.setVariable("user", user);
embedded.setVariable("searchList", searchList);
embedded.setVariable("results", results);embedded.setScript(Global.loadResource("resources/alert-html.jelly"));
boolean bStatus = embedded.execute();
if (!bStatus) {
String errorMsg = embedded.getErrorMsg();
log.error("Error in jelly: "+errorMsg);
}
return os.toString();in the jelly script you can use the normal ${user.name} etc from the variables I stored above
-- Jason Lea
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
