You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by JB...@silenus.com on 2001/08/21 22:13:05 UTC

JSP/Servlet Printing

This is a question I posted in Sun's Java Forums and got no replies.  I
really need a solution and was hoping someone in this group could help out.

I have an Apache/Tomcat webserver on a standalone touchscreen kiosk. The
customer would like a print button on every jsp and, when touched by the
user, would like the page printed.  How do I do this?

1. I've tried the javascript print() method but I DON'T want the print
dialog to appear.  I want to print directly to the default printer.  Is
there a way to bypass the print dialog?

2. Also, in the servlet, I've tried to populate a JEditorPane with the html
and print it using the awt.print stuff.  But that doesn't work.  Is there a
trick to getting that working within a servlet?

Does anybody know how I can accomplish this by using the two approaches
I've listed or any other way?

Thanks,
JEB