----- Original Message -----
From: "Joe Kramer" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Tuesday, July 17, 2007 2:51 PM
Subject: Hot to access raw POST Data in servlet?
Hello,
I can't find a way to do a simple thing - access raw postdata in
servlet service()/doPost() method. (The data that goes after the
headers.)
In old Servlet API it was possible using
javax.servlet.http.HttpUtils.parsePostData() which is now deprecated.
Servlet API only seem to have methods to access request parameters and
properties in HttpServletRequest, but not the request data itself.
What is the best/pssible practice to do that?
Joe, I'm far too young to remember this function, so just slap me around if
I dont get it ;)
If all that function gave you was a HashTable of parameters then wont
"getParameterNames" be good enough?
Ie you can enumerate through them find the parameters and the values... like
this
Enumeration paramNames = request.getParameterNames();
while(paramNames.hasMoreElements()){
paramName = (String)paramNames.nextElement();
paramValue = request.getParameter(paramName);
}
or you could use getParameterMap.... if you looking for something close to
the old HashTable.
getInputStream... will give you the raw stream.
Young guys like me, use the Enumeration... its handy when you have more than
one submit button ;)
Thanks.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]