> From: Kyle Brantley [mailto:k...@averageurl.com]
> Subject: Reading POSTed data
> 
> I'm trying to read data which is posted directly to the server.

I'll assume you have a doPost() method in your servlet.

> I cannot figure out how to read this posted data from the servlet.

Read the servlet spec, not just the javadocs; section 3.1 discusses how POST 
data should be retrieved (as parameters).  Even if you limit yourself to the 
javadocs, you should have noticed this in ServletRequest.getParameter():

"If the parameter data was sent in the request body, such as occurs with an 
HTTP POST request, then reading the body directly via getInputStream() or 
getReader() can interfere with the execution of this method."

The variations of getParameter(), especially getParameterMap(), can be quite 
useful.

A simple example:
http://www.javareference.com/jrexamples/viewexample.jsp?id=101

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to