FW: WOApplet: javax.print.PrintServiceLookup problem
FW: WOApplet: javax.print.PrintServiceLookup problem
- Subject: FW: WOApplet: javax.print.PrintServiceLookup problem
- From: <email@hidden>
- Date: Wed, 1 Sep 2004 10:00:18 +0200
- Thread-topic: WOApplet: javax.print.PrintServiceLookup problem
Sorry for the cross-post. I'm trying to broaden my audience as I take it not many are using (WO)Applets.
Pierre
-----Original Message-----
From: Pierre Bernard
Sent: Tuesday, August 31, 2004 11:42 AM
To: 'Apple WebObjects Dev'
Subject: WOApplet: javax.print.PrintServiceLookup problem
Hi!
I trying to print from an applet that is provided to the client by a WebObjects application.
When I look for printers javax.print.PrintServiceLookup goes looking for a file named /META-INF/services/javax.print.PrintServiceLookup. As I understand it, it expects that file to contain a list of service provider classes.
Trouble is that while looking for that file the class loader goes back to the server where it got the applet JAR from. The actual URL depends on the codebase argument passed to the applet. That is suffixed by /META-INF/services/javax.print.PrintServiceLookup. The applet thus calls into the WebObjects application at an odd URL.
Besides the extra network traffic and erroneous hit to the application, the applet crashes over the response provided by the WebObjects application. Indeed PrintServiceLookup expects a well-formed, potentially empty, file or a 404 error. What it gets though is the application's error page.
As a VERY UGLY workaround I can call the print service lookup twice: on the second attempt it no longer goes for the PrintServiceLookup file.
Much better would be to provide the needed file. I have added it to my applet JAR. This oddly enough did not help. Is my codebase argument wrong for this to work.
I could also fool around with the codebase argument so that no file can be found. I'm not sure though of other implications of this.
I guess I could also provide a codebase pointing to the framework containing the requested file. The way I see it, this could work in deployment. During development, however, the codebase would point the WOResourceManager.
Anybody succeeded in printing from a WebObjects provided applet?
TIA
Pierre
**********************************************************************
This email and any files transmitted with it are intended solely for
the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender
of this message. (email@hidden)
This email message has been checked for the presence of computer
viruses; however this protection does not ensure this message is
virus free.
Banque centrale du Luxembourg; Tel ++352-4774-1; http://www.bcl.lu
**********************************************************************
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.