Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF Mail Components

 
Bipin Sanker
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bipin Sanker
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic