• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing a web page using the Printable class

 
Andres Delrotti
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,

I am currently creating a reporting application. One of its features include being able to print the report page in a printable format. Now, our client wanted to eliminate the annoying printer settings UI that comes out everytime we use the window.print() javascript command to print a webpage. So in order to eliminate this, we resorted to using Java's Printable Interface in which we would just enter the Report Page's URL and let it to the print job without having the print settings UI to pop up. The print button at the Report Page would now call a Servlet which would then call the class which implements the Printable interface.

Now the Problem is,

The URL of the report page that we would like to print is eg. (http://localhost:9080/MyApp/PrintReportPage.do) which is a Struts link. If we input that exact url in the class that implements Printable, we could not print the report page the way we like it since THE SESSION ALWAYS TERMINATES. The page containing the error "session was terminated" was printed instead of the Report Page.

Is there any way to solve this type of problem?
[ August 02, 2006: Message edited by: aj delr ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahem, you are aware of the fact that the servlet would print on the server side, not on the client side?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!