aspose file tools
The moose likes Applets and the fly likes Applets on Apples (yum...) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide 1Z0-808 this week in the OCAJP forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applets on Apples (yum...)" Watch "Applets on Apples (yum...)" New topic

Applets on Apples (yum...)

Joel McNary

Joined: Aug 20, 2001
Posts: 1824

I have a situation where I have an applet that needs to run on both the Macintosh and Windows platforms. The applet works fine under windows; however, on the Macintosh nothing appears (I wind up with a blank web page). The applets, upon loading, are supposed to communicate with a series of servlets running on a Websphere App Server; the servlets, in turn, communicate with the EJBs running on said app server. Data is pased back through the servlet to the applets. I have tried everything that I could think of to get this to run; it seems to reach a point in the code and just hangs. Any thoughts/suggestions/ideas/request for more information?

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Tim Blommerde

Joined: Sep 24, 2001
Posts: 21
This might sound like a stupid question, but what browsers are you using to test the applet? I'm no Applet Guru, but for as far as I know, the way to call an applet in the HTML code is different between the two major browsers (Netscape and Internet Explorer) as well as the JVM the applets run in. So an applet might run in IE, but not in Netscape.
So, could you provide some more information on the browsers you're using to test the applet, because that's probably your problem. If you're using a IE on your windows environment and Netscape on your Mac, I'd search the web for some documentation on browser-differences for applets.
Good luck,
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

Originally posted by Tim Blommerde:
This might sound like a stupid question, but what browsers are you using to test the applet?

We are using IE to test the applet on both PC and MAC. The HTML code was generated through Sun's HTML converter (so that it would run on both IE and Netscape). (Actuallly, a template was generated and a servlet serves the code that loads the applet...strange, but the customer wants the Swing GUI on a web-based application).
I have actaully tracked down the problem to the URLConnection. Anytime the applet needs to communicate with an EJB, it has to do so through a servlet. To talk to the servlet, it has to open a URLConnection to that servlet. I managed to get the applet to load, but it hangs the second time the servlet is accessed after the applet loads (it accesses the servlet(s) multiple times during the applet load).
The original problem where the applet would not load was due to the fact that I was attempting to manually diconnect the URLConnection (HttpURLConnection). The Mac did not like this, and it does not like getting the Output stream to the URL on future connects. The code look slike this:
I agree. Here's the link:
subject: Applets on Apples (yum...)