File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Printing In Servlet Using Apache Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Printing In Servlet Using Apache Tomcat" Watch "Printing In Servlet Using Apache Tomcat" New topic

Printing In Servlet Using Apache Tomcat

Raghava Nagaraj

Joined: Nov 05, 2004
Posts: 8
Hi All

I am Using javax.print API to print Documents through Servlet. But while Doing it in Apache Tomcat Server. Null Pointer Exception is Thrown.

PrintService service = PrintServiceLookup.lookupDefaultPrintService();

In this Code Service is Getting null Value.

If I run same programm using servletrunner . then the document is Printed!

Is their any Configuration to set in Apache ?

Waiting for Replies..!
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
There we go again, the daily dose of client/server confusion...

If you print from a servlet it will use a printer on the SERVER. If there is no printer (or the server doesn't allow the servlet to use it)...

I agree. Here's the link:
subject: Printing In Servlet Using Apache Tomcat
It's not a secret anymore!