Hi Roland,
         Thanks for showing me the right way, 
  Could you clarify me one more doubt,
  If I want to write params and as well objects,  
  Should i use ByteArrayPart with StringPart, is this the right way.  or Is 
there any other better ways of doing this.
   
  Thanks,
  Sheetal
   
  
Roland Weber <[EMAIL PROTECTED]> wrote:
  Hello Sheetal,

> post.addRequestParameter("1","2");
> post.addRequestParameter("3","4");
> post.setRequsetEntity();
> // These two will not work together,

Right, they won't. Either you set the parameters which will create
a request entity with url-form-encoding, or you set a request entity
and the parameters will be ignored.
If you set a request entity and still need to set parameters, you
probably need the multipart request entity which will not be parsed
by the servlet engine, as you have detected. If you need to do a
file upload, you will have to use the multipart request entity.


> When I use parts, Again I need to use ObjectInopuStream and read accorndly,

You *never* use an ObjectInputStream, unless you have to deserialize
Java objects!

> Is it should always read using OutputStream.

You cannot read from an OutputStream. Output streams are for writing.

You can use the InputStream of the request object on the server side
to access the multipart-encoded request entity. Since you will need
a server-side parser for multipart request entities, you should have
a look at the FileUpload project:

http://jakarta.apache.org/commons/fileupload/


hope that helps,
Roland

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to