aspose file tools*
The moose likes Servlets and the fly likes Passing Objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Passing Objects" Watch "Passing Objects" New topic
Author

Passing Objects

Jeff Wisard
Ranch Hand

Joined: Jan 07, 2002
Posts: 89
Hi,
I have an applet that needs to pass objects back and forth to a servlet. Can anyone show me an example of the servlet code for this? (The applet code would be helpful as well...)
Thanks!
-Jeff


Jeff Wisard<br />Sun Certified Java Programmer (Java 2)<br />Sun Certified Web Component Developer
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12835
    
    5
There is an example in my Servlets and JSP book using some classes that Paul Weaton wrote. That com.javaranch library is somewhere on JavaRanch but I don't remember how to get to it.
If you will drop me a line, I can send you the code from that chapter.
wbrogden@bga.com
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

You can find the Javaranch Common Classes info here
Dave.
Jeff Wisard
Ranch Hand

Joined: Jan 07, 2002
Posts: 89
Alright. Cool and thanks. Next Question: Essentially what I want to do is stream a large amount of data from the servlet to the applet. What I need to do is send this data in blocks. For example, I have an array of 1000 objects (all serializable) and I want to send them to the applet in blocks of 100....all within the same request. What are the issues here? Can I send more than one block (array of objects) via the ObjectOutputStream.writeObject() method without closing the output stream?
I also noted that the code you pointed me to is using GZIPInputStream. What are the advantages and disadvantages of this?
Thanks again.
-Jeff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing Objects