• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlets and applets  RSS feed

 
John Miller
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have a applet. When the user click the list button on the applet the applet creates an instance of my list class. The list class does the follwing: calls my HttpRequest class's proceesPostRequest. The HttpRequest class returns a InputStream. The following code come from the List class:
InputStream in = proc.processPostRequest(props);
ObjectInputStream result = new ObjectInputStream(in);
The follwing code comes from the HttpResuest class: DataOutputStream out = new DataOutputStream(con.getOutputStream);
return con.getInputStream();
Now for the problem. My servlet that gets called form the HttpRequest class, always had the out.writeOjbect() lines. I created the servlet so that the servlet initiates a specified class and this class now contains the out.writeOjbect() lines.
This causes a java.io.CorruptedStreamException
What must i do to use the writeOjbect() method in the class that in initiated by the servlet and properly get it at my HttpRequest class.
Thanks
Schalk
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!