Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

access generated html

 
A Pinheiro
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello to you all and I'm really sorry if this doesn't belong here...

So I'm using JSP to generate my html and what I would like is to access the response complete with the whole html generated by the JSP and generate a pdf from it.

I know how I could generate the pdf from the html, I need help just figuring out how I can access the generated html. And I'm guessing I will have problems when I'll want to clean the response outputstream and serve a pdf instead...

Any ideas?

Thanks a lot,
 
Stefan Evans
Bartender
Posts: 1690
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a job for (dum da da dum da da DAAAAA!) a Servlet filter!

The servlet filter can create a wrapped response object to pass down to lower layers, that can read the response output stream coming from your JSP, and get the HTML.
It can then process that and write to the REAL output stream going back to the client.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic