Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Printing In Servlet Using Apache Tomcat

 
Raghava Nagaraj
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic