This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Applets and the fly likes HTTP - tunneling and Objects.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "HTTP - tunneling and Objects.." Watch "HTTP - tunneling and Objects.." New topic

HTTP - tunneling and Objects..

Ilja Smoli
Ranch Hand

Joined: Dec 02, 2001
Posts: 64
I've done Http tunneling between servlet and applet. Servlet sends objects to applet using ObjectOutputStream writeObject() method. Question is:
I have a class lets say MyObject.
Than i create an instance of this like:

To get it in applet i have to cast this object to something like

So i have to have a copy of MyObject class located with applet on client side? Im I right?
And second question: is it possible to send few objects at once?
Thx in advance...
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
Hi Ilja
Yes you can send multiple objects in the stream following either of the following ways,
1. Create vector, arraylist , collection of the objects and send them at first shot
2. write multiple object by calling write() serveral times to the outputstream
In either case you have to remember how you are sending the objects and recieve them appropriately.
ALso, make sure your objects are Serializable (or Externalizable)..
jQuery in Action, 3rd edition
subject: HTTP - tunneling and Objects..
jQuery in Action, 3rd edition