File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes JSF Mail Components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF Mail Components " Watch "JSF Mail Components " New topic

JSF Mail Components

Bipin Sanker

Joined: Mar 17, 2008
Posts: 2
Hi. I want to display a datatable in the body of the email while sending it. Is there is any components for doing that.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17421

Not directly. The simplest way would be to simply iterate the data model and write out the data as plain text lines (I'm not a fan of HTML email). However, you could also build a JSF page that produces HTML form - including the datatable tag, and have your action processor do an internal HTTP request for that page, which you would then encapsulate in the email message you're building. There's a fair amount of overhead involved there, including the fact that you'd probably need to propagate your session to the internal request. However, it's relatively immune to breakage.

If you're sufficiently devious, you could probably gain some speed by short-circuiting the internal HTTP request, but that would put you more at risk when the framework changes. Also, it would limit some of your load-balancing options, but that's only an issue for really heavy load systems.

An IDE is no substitute for an Intelligent Developer.
Bipin Sanker

Joined: Mar 17, 2008
Posts: 2
HI thanks for your kind information. Is there is any other API or third party vendors who has the easy way of sendinf email with the datatable in it???
Because it has to be done immediatly....
I agree. Here's the link:
subject: JSF Mail Components
It's not a secret anymore!