I'm running a Web app that uses the javax.print API to
do discovery on attached printers and passes a
java.util.List of names to a JSP to display to clients
in an HTML select box . I'm running under Tomcat
4.1.29 on Windows 2000 SP 4 and Sun's JDK 1.4.1_03.
The drop-down list box is empty - no printers were
found. I have three attached printers, so I know the
list box should not be empty.
I have a Command class that gets all the available
printers. The pertinent lines are:
List availablePrinters = new ArrayList();
SecurityManager securityGuard =
System.getSecurityManager();
if (securityGuard != null)
securityGuard.checkPrintJobAccess();
else
System.out.println("No security guard; could not
check print job access");
PrintService [] ps =
PrintServiceLookup.lookupPrintServices(DocFlavor.INPUT_STREAM.AUTOSENSE,
null);
I put some print statements into the code so I could
see what was happening. I get this out in the log
file:
No security guard; could not check print job
accessFound zero available printers
If I take this code and run it in a desktop app I get
back three printers and I can print to my default
printer without a problem.
I KNOW that I ran this app on Tomcat 4.1.24 and saw
printers in the drop-down. I downloaded and tried
running the app under the older version of Tomcat, but
it, too, shows an empty drop-down.
My notes aren't telling me what I did to allow printer
discovery. Can anyone refresh my memory? Thanks -
MOD
__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]