The reason this happens is because Servlet/JSP specifications do not
handle multipart requests, by design (I do not know why). Java
developers therefore have to either parse the stream in their programs
or use one of many libraries out there for this purpose.

Apache Commons FileUpload
(http://jakarta.apache.org/commons/fileupload/)
Cos (http://www.servlets.com/cos/)

-Hareesh



-----Original Message-----
From: Sheetal D [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 07, 2006 12:29 PM
To: [email protected]
Subject: Help on Requst Params in Post

Hi all, 
          I have seen some of the queries on this. I still could not
find the reason why I am not able to get request parameters in Post.
  Because, I need to write both StringPart and Objects using
RequestEntities. 
  I have used the example given in the API,
          PostMethod filePost = new PostMethod(url);
        try{
             Part[] parts = { new StringPart("sheetal",
"sheetalPassword") };
               filePost.setRequestEntity(
                           new MultipartRequestEntity( parts,
filePost.getParams()) );
               HttpClient client = new HttpClient();
             int status = client.executeMethod(filePost);
            System.out.println("The status code is
"+client.executeMethod(filePost));

  StatusCode returns properly, But When I get the parameter in JSP.
   <% System.out.println(request.getParameter("sheetal"))%>
  It will print null, Could anybody tell me what mistake I am making.
   
  Thanks,
  Sheetal
   
   
   
   
   
   

                
---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC and
save big.

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

Reply via email to