aspose file tools*
The moose likes Servlets and the fly likes Servlet/applet communication failure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet/applet communication failure" Watch "Servlet/applet communication failure" New topic
Author

Servlet/applet communication failure

Ken Siberz
Greenhorn

Joined: Jul 25, 2001
Posts: 1
I am plagued by an intermittant failure of getInputStream after successfully opening a URL connection to a servlet.
My applet periodically opens a URL connection to a servlet to receive data. The servlet acquires the data and sends an array of strings to the applet in an ObjectOutputStream. After a number of successful responses from the servlet, the applet hangs on a "connection.getInputStream()" method call. Here is part of the code, which is executed each time the applet needs data:
URL dataURL = new URL(...);
URLConnection connection = dataURL.openConnection();
connection.setUseCaches(false);
InputStream URLin = connection.getInputStream();
Here's where it eventually hangs -- after from 5 to 50 successful iterations. I am testing with JRun 3.0.
Thanks for any help!
Ken
Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
if you use under jdk1.3 from servlet to applet must declare Contentlength=how many bytes


Senior software engineer
Dorj Galaa
Ranch Hand

Joined: May 29, 2001
Posts: 113
see http://s1.sun.com/Search/fortebugs?qt=content-length&col=obug&qp=&rf=0
 
Don't get me started about those stupid light bulbs.
 
subject: Servlet/applet communication failure
 
Similar Threads
Applets and URL connections.
Implementing multi-tire application and persistent DB connection in WebLogic
URLConnection & writing HTML back to browser
How to get a String from an InputStream
how to invoke applet from servlet