Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing Objects

 
Jeff Wisard
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find the Javaranch Common Classes info here
Dave.
 
Jeff Wisard
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic