Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing and Servlets  RSS feed

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On a html page there are two options of viewing data. One is display and the other is print. when the user clicks on the display button, data can be viewed on the screen.
However when the user clicks the print button the data should not be displayed on the screen instead it should go directly to the printer. I'm using a servlet for displaying data.
For the print function , I'm using a class which implements the printable interface.The data to be printed is passed as a string.
The problem is I cannot create an object of this class in a servlet.
The exceptions thrown are ClassDefNotFound,DuplicationError,ClassFormat Error etc.
So how do I go about it.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!