• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Capturing dynamic generated HTML Content on action call

 
mozammil muzza
Ranch Hand
Posts: 32
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to capture dynamic generated html content on server side on command button's action call, but not able to get the exact dynamic content.

Let's say, i have one page which displays items in data table with check boxes (grid) and when i select some checkbox and click on some command button (preview), it takes me to the next view where all informations of this selected items shows in panels as preview, then i have one button (command button) on preview page on whose click complete preview page should be send as an email (html email) as an action call.
So on this action call, i want to capture this preview page html content, so that i can send this as an email.

I am not able to get the contents on server side.


Please help me, how can i achieve this. :)
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18100
51
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There isn't any easy way to do this.

You are better off doing a separate HTML format to produce the email body text. If you prefer to use a template to generate that HTML, there are a number of template engines that can do the job. A current project of mine uses the Apache Velocity engine for that purpose.
 
mozammil muzza
Ranch Hand
Posts: 32
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Tim for reply,

actually here i am able to get the content using URL openStream method.
But as i am using JSF with Primefaces, when i am sending that html content as mail body, its not rendering correctly.

On Outlook, it is coming as raw xthml content.

Is there any other way i can show this on mail in the same way how it is rendering on browser .
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18100
51
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know what you are doing, but if you are getting "xhtml" back, you are not running the request through JSF. JSF only uses the xhtml (View Definition Language) resources as templates for the FacesSerlet to process and render as the output HTML.

 
mozammil muzza
Ranch Hand
Posts: 32
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
content what i am getting on server side is same that i can see on right click and view source of the page.
but problem now i am getting is, when attaching this content to mail's body and sending it, it is not getting rendered on MS Outlook as html, but simpy coming as raw html text, i.e. <html> <body> ...

Please suggest how i can send this content as a mail so that i can be rendered as html page on Outlook.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic