my dog learned polymorphism*
The moose likes Applets and the fly likes Applet freezes after displaying pages using showDocument Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet freezes after displaying pages using showDocument" Watch "Applet freezes after displaying pages using showDocument" New topic
Author

Applet freezes after displaying pages using showDocument

Elie Hirschman
Ranch Hand

Joined: Dec 15, 2005
Posts: 37
I have an applet which has clickable areas that redirect to jsps, and the user can then click back to the applet page. The code is done in the applet using the getAppletContext().showDocument(URL) method.
However, I have noticed after a recent build, that when I click on the link to visit page X, upon returning to the applet page, it is 9 times out of 10 FREEZING up and not responding.
I have set timeouts on the connect and read, to no avail. I see from the logging output that the applet stops responding at this line:


The url it is contacting is a servlet, from which it should've been receiving a Vector object.
The Servlet has the proper code in place for closing outputstreams, but for some reason the applet cannot connect to it after that call to showDocument().
Is there something I am missing here?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42371
    
  64
Is the server responding in time? Meaning, can you see in the server logs that it returns something to the applet?


Ping & DNS - my free Android networking tools app
Elie Hirschman
Ranch Hand

Joined: Dec 15, 2005
Posts: 37
Ulf Dittmer wrote:Is the server responding in time? Meaning, can you see in the server logs that it returns something to the applet?

The logs show timely (immediate) access and response in the servlet calls prior to visiting page X, but after returning to the applet page, the server is NOT being hit - I have this set up in my IDE and I will see breakpoints in the servlet code being hit in the initial visits to the applet page, but not after visiting page X.
Elie Hirschman
Ranch Hand

Joined: Dec 15, 2005
Posts: 37
I found a work-around which I will use (for now) - I am using the showDocument() call not to navigate to another page, but to fire a javascript popup modal window, as so:

line from the Java applet:


this calls the Javascript function on the jsp:


...where showModal is a proprietary function to launch a new modal window with the provided url and window dimensions.

Still wondering why I was experiencing such a problem, though.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16158
    
  21

Java versions 6.0.10 and earlier had a known problem when handing off from one applet to another. It drove CPU utilization up to 100%.

Some people claimed problems with 6.0.10 as well, but for me the problem magically disappeared at that point.


Customer surveys are for companies who didn't pay proper attention to begin with.
Elie Hirschman
Ranch Hand

Joined: Dec 15, 2005
Posts: 37
Tim Holloway wrote:Java versions 6.0.10 and earlier had a known problem when handing off from one applet to another. It drove CPU utilization up to 100%.

Some people claimed problems with 6.0.10 as well, but for me the problem magically disappeared at that point.


Some of my users are using JRE 1.6.0_6, but most are using 1.6.0_15-b03. I personally have the latest and greatest and was still having the issue.
The other thing is, Page X was just a simple JSP with NO applets on it. So it was an applet doing a showDocument on a page with no applets, and returning to a page WITH applets that was causing the locking - still not understanding why.


(BTW, I almost wrote "SITH applets" above... how cool would those applets be!!)
 
Don't get me started about those stupid light bulbs.
 
subject: Applet freezes after displaying pages using showDocument