W3C home > Mailing lists > Public > www-jigsaw@w3.org > January to February 2004

Re: Urlconnection-setrequestproperty

From: Olivier Nizet <jiaozi@pop.meloo.com>
Date: Sun, 18 Jan 2004 17:20:38 -0500 (EST)
To: www-jigsaw@w3.org
Message-id: <400b0652.100.48f0.335553683@pop.meloo.com>



Hi,

to send a serialized object from an applet to a servlet,
you have to write:

URL urlServlet = new URL("a servlet address");
URLConnection conn = urlServlet.openConnection();

conn.setUseCaches(false);
conn.setDefaultUseCaches(false);
connection.setDoOutput(true);
setRequestProperty("Content-Type","application/x-java-serialized-object");

ObjectOutputStream oos = new
ObjectOutputStream(conn.getOutputStream());

oos.writeObject(myObject);
oos.flush(); // to be sure

Hope that help you,
Jiaozi

-------------------------------------------------
           http://www.meloo.com       

Ce mel a été scanné contre plus de 32 000 virus !
Received on Monday, 19 January 2004 11:52:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:36 GMT