Re: Reading POSTed data

2009-06-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 6/19/2009 4:10 PM, Caldarale, Charles R wrote: From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: Reading POSTed data The servlet spec is very clear about when the request is consumed to fulfill

Re: Reading POSTed data

2009-06-22 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 6/20/2009 7:59 AM, André Warnier wrote: Or as multipart/form-data... Now this raises an additional nitpicking question : It has been mentioned before, that Tomcat provides no standard mechanism to read POST parameters that have been

Re: Reading POSTed data

2009-06-20 Thread André Warnier
Caldarale, Charles R wrote: From: Alan Chaney [mailto:a...@compulsivecreative.com] Subject: Re: Reading POSTed data I don't want to appear picky, but that doesn't actually seem that problematic. If you don't set the content type as application/x-ww-form-urlencoded then you should be able

Re: Reading POSTed data

2009-06-20 Thread David Smith
André Warnier wrote: Caldarale, Charles R wrote: From: Alan Chaney [mailto:a...@compulsivecreative.com] Subject: Re: Reading POSTed data I don't want to appear picky, but that doesn't actually seem that problematic. If you don't set the content type as application/x-ww-form-urlencoded

Re: Reading POSTed data

2009-06-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, As fun as beating a dead horse is... On 6/17/2009 6:28 PM, André Warnier wrote: My point (awaiting a more expert opinion still), is that I believe that the way the servlet spec is written, you may very well get away with it under one

Re: Reading POSTed data

2009-06-19 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 6/17/2009 6:42 PM, André Warnier wrote: .. just don't do any getParameter() with your stuff. That, I believe, /may/ still get you in trouble. But I'm sure by now Chuck is already checking the Tomcat code of getParameter(), to see if

RE: Reading POSTed data

2009-06-19 Thread Caldarale, Charles R
From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: Reading POSTed data The servlet spec is very clear about when the request is consumed to fulfill a getParameter call and when the request is specifically /not/ consumed. What I find problematic is that the spec

Re: Reading POSTed data

2009-06-19 Thread Alan Chaney
Caldarale, Charles R wrote: From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: Reading POSTed data The servlet spec is very clear about when the request is consumed to fulfill a getParameter call and when the request is specifically /not/ consumed. What I find

RE: Reading POSTed data

2009-06-19 Thread Caldarale, Charles R
From: Alan Chaney [mailto:a...@compulsivecreative.com] Subject: Re: Reading POSTed data I don't want to appear picky, but that doesn't actually seem that problematic. If you don't set the content type as application/x-ww-form-urlencoded then you should be able to read it via the input

Re: Reading POSTed data

2009-06-17 Thread André Warnier
Kyle Brantley (and many others) wrote: ... Sorry to interrupt, but actually guys I believe that the problem is due to the way the data is POSTed, which in this case is - I believe - invalid. See http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4 The data of a POST can be sent according

Re: Reading POSTed data

2009-06-17 Thread André Warnier
André Warnier wrote: Addendum : from Servlet Spec 2.5 : SRV.3.1.1 When Parameters Are Available The following are the conditions that must be met before post form data will be populated to the parameter set: 1. The request is an HTTP or HTTPS request. 2. The HTTP method is POST. 3. The

Re: Reading POSTed data

2009-06-17 Thread Tim Funk
Change your loop to be: int i; while ((i=in.read())) { out.write(i); } available() - Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. So its not an accurate gauge of how much

Re: Reading POSTed data

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Kyle, On 6/16/2009 11:24 PM, Kyle Brantley wrote: The getParameter() calls are going to be of little to no value for me. The data isn't in a form where those calls would recognize them. Unless I'm missing something very obvious...? No, if you're

Re: Reading POSTed data

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 6/17/2009 4:06 AM, André Warnier wrote: Sorry to interrupt, but actually guys I believe that the problem is due to the way the data is POSTed, which in this case is - I believe - invalid. See

Re: Reading POSTed data

2009-06-17 Thread Kyle Brantley
Tim Funk wrote: available() - Returns the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. So its not an accurate gauge of how much content is available from the client. That explains that quite

Re: Reading POSTed data

2009-06-17 Thread André Warnier
Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 6/17/2009 4:06 AM, André Warnier wrote: Sorry to interrupt, but actually guys I believe that the problem is due to the way the data is POSTed, which in this case is - I believe - invalid. See

RE: Reading POSTed data

2009-06-17 Thread Caldarale, Charles R
From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: Reading POSTed data Maybe I am interpreting this one step too far, but it seems to me from all this, that the designers of the Servlet Spec at least, were only planning for form data, in pairs of parameter=value, and not for one big

Re: Reading POSTed data

2009-06-17 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 6/17/2009 4:58 PM, André Warnier wrote: Christopher Schultz wrote: Note that [restricted content-type] is an HTML thing, not an HTTP thing. HTML forms may only be sent using two distinct Content-Types, but HTTP POST can do anything it

Re: Reading POSTed data

2009-06-17 Thread Kyle Brantley
André Warnier wrote: To me thus, the correct way - and the only way a browser would do it - to POST this data, would be in the form of a multipart/form-data body, itself composed of a MIME header and a body that would be the XML blob. If I may: function loadXMLDoc(xmlRequest) {

Re: Reading POSTed data

2009-06-17 Thread David Smith
André Warnier wrote: Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 6/17/2009 4:06 AM, André Warnier wrote: Sorry to interrupt, but actually guys I believe that the problem is due to the way the data is POSTed, which in this case is - I believe -

Re: Reading POSTed data

2009-06-17 Thread André Warnier
Kyle Brantley wrote: ... My point, is that it is entirely possible for a browser to POST data to a resource without sending it as multipart/form-data or application/x-www-form-urlencoded. Hey! that is cheating. You never mentioned Javascript before. ;-) But true. I wasn't thinking of

Re: Reading POSTed data

2009-06-17 Thread André Warnier
David Smith wrote: Having had to recently do some SOAP work, it looks to me that is at least partially what the OP was trying to begin with. SOAP performs a POST with XML as the body of the request. It's not URI encoded parameters or multipart data like the HTML Form posts, but a standard

Re: Reading POSTed data

2009-06-17 Thread Kyle Brantley
André Warnier wrote: Kyle Brantley wrote: ... My point, is that it is entirely possible for a browser to POST data to a resource without sending it as multipart/form-data or application/x-www-form-urlencoded. Hey! that is cheating. You never mentioned Javascript before. ;-) But true. I

RE: Reading POSTed data

2009-06-17 Thread Martin Gainty
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Wed, 17 Jun 2009 16:45:34 -0600 From: k...@averageurl.com To: users@tomcat.apache.org Subject: Re: Reading POSTed data André Warnier wrote: Kyle Brantley wrote: ... My

Reading POSTed data

2009-06-16 Thread Kyle Brantley
I'm just starting poking with servlets, and simply cannot figure out how to do this. I'm trying to read data which is posted directly to the server. The HTTP POST looks something like this: POST /api/ HTTP/1.1 User-Agent: Jakarta Commons-HttpClient/3.1 Host: averageurl.com Content-Length: 94

RE: Reading POSTed data

2009-06-16 Thread Caldarale, Charles R
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

Re: Reading POSTed data

2009-06-16 Thread Kyle Brantley
Caldarale, Charles R wrote: 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 do. I cannot figure out how to read this posted data

Re: Reading POSTed data

2009-06-16 Thread Len Popp
2009/6/16 Caldarale, Charles R chuck.caldar...@unisys.com: From: Kyle Brantley [mailto:k...@averageurl.com] Subject: Reading POSTed data 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

RE: Reading POSTed data

2009-06-16 Thread Caldarale, Charles R
From: Kyle Brantley [mailto:k...@averageurl.com] Subject: Re: Reading POSTed data The data isn't in a form where those calls would recognize them. To be a proper POST body, it must be. The content should be preceded by something like xml= (without the quotes), and then you would retrieve

RE: Reading POSTed data

2009-06-16 Thread Caldarale, Charles R
From: Len Popp [mailto:len.p...@gmail.com] Subject: Re: Reading POSTed data Ah, but section 3.1.1 says that POST data is only available through getParameter if the content type is application/x-www-form-urlencoded. You're right, I missed that. There must be something else getting

Re: Reading POSTed data

2009-06-16 Thread Kyle Brantley
On 06/16/2009 09:36 PM, Caldarale, Charles R wrote: From: Len Popp [mailto:len.p...@gmail.com] Subject: Re: Reading POSTed data Ah, but section 3.1.1 says that POST data is only available through getParameter if the content type is application/x-www-form-urlencoded. You're right, I missed