tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "???" <waste...@secure1.co.kr>
Subject RE: About Servlet-Applet Communication
Date Tue, 10 Oct 2000 01:20:42 GMT
Thank for ur kind response.
I had tried as you taught me but failed.-_-
<--applet side-->
ObjectOutputStream os = new ObjectOutputStream(uc.getOutputStream()); 
	      os.writeObject("leftItem");
	      os.flush();
	      os.close();
<--servlet side-->
try 
{ 
                 temp = (String)is.readObject(); 
                  // Display the string 
            }catch (ClassNotFoundException e){ 
                  System.out.println("Class Not found Exception"); 
             }
 

-----Original Message-----
From: Matt Goss [mailto:mgoss@rtci.com]
Sent: Tuesday, October 10, 2000 2:31 AM
To: tomcat-user@jakarta.apache.org
Subject: Re: About Servlet-Applet Communication


what you want to do is use the output stream from the response as an
object stream like this:
<on the servlet side>
Object myobject = new Object();
java.io.ObjectOutputStream os = new
ObjectOutputStream(resp.getOutputStream());
os.writeObject(myobject);
</on the servlet side>
<on the applet side>
ObjectInputStream ois = new ObjectInputStream(conn.getInputStream());
Object myobject =  (Object) ois.readObject();
ois.close();
</on the applet side>
That works for me...
Matt Goss
Mime
View raw message