This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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