Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Send both parameters and objects to servlet

Reply
Thread Tools

Send both parameters and objects to servlet

 
 
kikotores@yahoo.com
Guest
Posts: n/a
 
      05-31-2006
Is it possible to send both parameters ( as if coming from a form) and
binary objects( such as vector) from an applet to a servlet. I want to
be able to read properties as regular parameters using getParameter and
also get objects. Is this possible and if so how do I set up the
regular parameters ( provided I am writing the binary objects to a
stream) and how do I then retrieve them.

 
Reply With Quote
 
 
 
 
Matt Humphrey
Guest
Posts: n/a
 
      06-01-2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Is it possible to send both parameters ( as if coming from a form) and
> binary objects( such as vector) from an applet to a servlet. I want to
> be able to read properties as regular parameters using getParameter and
> also get objects. Is this possible and if so how do I set up the
> regular parameters ( provided I am writing the binary objects to a
> stream) and how do I then retrieve them.


getParameter () returns a String so you have to encode your object as a
String--essentially making it a parameter. You can do this by serializing to
byte [] and then encoding with Base64 or serializing to XML (e.g. XStream)
and encoding with URLEncoder (or it's non-deprecated equivalent). String
representations of objects (object graphs) can get very big and there may be
limits on the total sizes of all the parameters in a GET request. You
should be able to send via POST without problem.

When you perform getParameter, just decode and deserialize back to get a
copy of the object.

Matt Humphrey http://www.velocityreviews.com/forums/(E-Mail Removed) http://www.iviz.com/


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Servlet] how to send a stream to servlet doPost =?utf-8?B?6L65IOaxnw==?= Java 3 09-14-2007 02:17 PM
2 computers, both online, both invisible to each other ? b Computer Support 9 04-21-2006 04:06 AM
how can I send parameters from a javascript to a servlet? christina.saavedra@gmail.com Javascript 0 08-10-2005 02:56 PM
Servlet parameters different from the command line parameters? Jonck van der Kogel Java 2 05-26-2004 11:34 PM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM



Advertisments