• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Capturing dynamic generated HTML Content on action call

 
Ranch Hand
Posts: 32
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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. :)
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic