Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

RE: Problem with Web app, javax.print, SecurityManager, and printer discovery

Michael Duffy

2004-01-08

Replies:


Now that I have your reminder, I can see that I've got
the fix in my notes dated 27Jun2003. Too bad I wasn't
looking back that far before I sent my note to the
list. I'm glad your memory is better than mine.

Sorry to bother you again, Yoav. I hope your holidays
were good, and my best to you for the new year.
Thanks again for watching this list. Sincerely, MOD


--- "Shapira, Yoav" <Yoav.Shapira@(protected):
>
> Howdy,
> I remember helping with this a while ago. Ahh, yes:
>
http://marc.theaimsgroup.com/?l=tomcat-user&m=105672303905158&w=2
>
> Yoav Shapira
> Millennium ChemInformatics
>
>
> >-----Original Message-----
> >From: Michael Duffy [mailto:duffymo@(protected)]
> >Sent: Thursday, January 08, 2004 8:22 AM
> >To: tomcat-user@(protected)
> >Subject: Problem with Web app, javax.print,
> SecurityManager, and
> printer
> >discovery
> >
> >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:
> tomcat-user-unsubscribe@(protected)
> >For additional commands, e-mail:
> tomcat-user-help@(protected)
>
>
>
>
> This e-mail, including any attachments, is a
> confidential business communication, and may contain
> information that is confidential, proprietary and/or
> privileged. This e-mail is intended only for the
> individual(s) to whom it is addressed, and may not
> be saved, copied, printed, disclosed or used by
> anyone else. If you are not the(an) intended
> recipient, please immediately delete this e-mail
> from your computer system and notify the sender.
> Thank you.
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@(protected)
> For additional commands, e-mail:
> tomcat-user-help@(protected)
>


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.