Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Object Output Streams and JApplets

 
adam d
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
please could you give me your thoughts. im attempting to open an object output stream to a servlet from a japplet but the japplet does not call the servlet. i used exactly the same code in an applet and it worked fine. i can also open a stream from the servlet to the japplet just not vice versa.
this is the code
try{
URL url = new URL(LOG_SERVLET);
URLConnection conn = url.openConnection();
conn.setUseCaches (false);
conn.setDefaultUseCaches(false);
conn.setDoOutput(true);
conn.setRequestProperty ("Content-Type", "application/octet-stream");
ObjectOutputStream oos = new ObjectOutputStream(conn.getOutputStream());
oos.writeObject(anObject);
oos.writeObject(anOtherObject);

oos.flush();
oos.close();
} catch(MalformedURLException mue) {
System.out.println(mue);
} catch(IOException ioe) {
System.out.println(ioe);
}
the code executes without throwing any errors but doesn't call the servlet. any ideas would be appricated.
adam
 
Nishith Prabhakar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Code seems to be OK buddy ... are you sure its not calling the servlet at all ?
What about the doInput and doOutput properties of the servlet?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic