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 bee

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

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.

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 sh

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 sh

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: 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 probl

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 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 ser

RE: Reading POSTed data

2009-06-17 Thread Martin Gainty
rageurl.com > To: users@tomcat.apache.org > Subject: Re: Reading POSTed data > > 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 mult

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 wasn't

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 POST

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 XMLHttpRe

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 -

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 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 any

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=

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 http://www.w3.org/T

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 ni

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 http://www.w3.org/TR/html401/interact/forms

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'r

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 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 cont

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 t

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 m

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 somet

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

Re: Reading POSTed data

2009-06-16 Thread Len Popp
2009/6/16 Caldarale, Charles R : >> 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 &g

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 p

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 s

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