File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Query about POST request body content Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Query about POST request body content" Watch "Query about POST request body content" New topic
Author

Query about POST request body content

Tushar Madhukar
Ranch Hand

Joined: May 03, 2006
Posts: 36
Hi,

I have a JSP page, which allows users to submit specific info to a web-app. Apart from the form parameters, the POST request needs to contain an XML string in the body of the request too.

Now, I am not sure how to set this XML in the body of the POST request. A normal form submission results in POST with content-type as 'application/x-www-form-urlencoded'. But, in this case, the body will contain XML too which should reflect in the content-type header. Is this kind of paradigm supported in HTTP? How can I do this?

Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
No, that wouldn't be reflected in the content type. The only option is to submit the XML as straight text - either in a text (or hidden) field, or a text area. There are no provisions for somehow "embedding" XML in an HTML form.


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Query about POST request body content
 
Similar Threads
upload servlet
calling getInputStream after getParameter
form to upload files
Parsing content body from a GET request
save a xml file using java