File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes between applet and servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark " between applet and servlet" Watch " between applet and servlet" New topic
Author between applet and servlet

may Lee
Ranch Hand

Joined: Nov 20, 2003
Posts: 68
I use the following code to pass an object from applet to servlet, then receive another object from servlet to applet. Got the error.
It is Signals that an end of file or end of stream has been reached unexpectedly during input. What could be the reason?

datato=new dataToservlet(year,month,day,hour,minute,timelength);
datafrom=new dataFromservlet(area,channelnum);

URL url=new URL(servletPath);
URLConnection conn=url.openConnection();
/****send object from applet to servlet******************/
ObjectOutputStream toServlet=new ObjectOutputStream(conn.getOutputStream());
/****get object df from servlet*********/
ObjectInputStream fromServlet=new ObjectInputStream(conn.getInputStream());
}catch(Exception e){appleterrormessage=e.toString();appleterror=true;}
I agree. Here's the link:
subject: between applet and servlet
Similar Threads
servlet/applet communication problem
Server returned HTTP response code: 504 for URL...
Applet Servlet communication
Object Read problem
Applet to Servlet Communication (only two ways?)