This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JSF and the fly likes Getting /resources in a BackedBean to send mails Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JSF
Bookmark "Getting /resources in a BackedBean to send mails" Watch "Getting /resources in a BackedBean to send mails" New topic

Getting /resources in a BackedBean to send mails

Ignacio de Cordoba

Joined: Jan 04, 2010
Posts: 13
Hi there,
I need to code a "Forgot password" backedbean in JSF2 that sends the password reminder mail. I used to use Freemarker templates for this in my previous Struts2 webapps and want to keep them. I need to access these templates, which I guess /resources/freemarker/ is a good place for them but ¿how can I read them from a [Managed] Backed Bean? I know I can do #{resource['freemarker:myTemplate.ftl']} in a JSF2 xhtml but could now find any method in FacesContext class (or other) to do this.

Thanks for any help/directions (of course, if there is any good practice or just better method to send templated mails in JSF2 applications I'm all ears)
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17018

Well, actually, I use Velocity, but JSF doesn't really get involved in where Velocity finds its resources. That's all determined by how I configure and invoke Velocity.

Customer surveys are for companies who didn't pay proper attention to begin with.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Getting /resources in a BackedBean to send mails
It's not a secret anymore!