tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@octo.com>
Subject RE: Tomcat 3.3 - Cactus Issue
Date Thu, 07 Feb 2002 15:58:57 GMT
Larry,

WebRequest.addParameter("param", "value", WebRequest.POST_METHOD) adds
(param, value) to a hashtable (retrieved by getParameterNamesPost() in
the code snippet below) that later (in HttpClientHelper.
addParametersPost()) will be used to add all the parameters as POST
data. 

Here are the relevant bits in HttpClientHelper :

Line 135:

    // Choose the method that we will use to post data :
    // - If at least one parameter is to be sent in the request body,
then
    //   we are doing a POST.
    // - If user data has been specified, then we are doing a POST
    if (theRequest.getParameterNamesPost().hasMoreElements() ||
        (theRequest.getUserData() != null)) {

        connection.setDoOutput(true);
    } else {
        connection.setDoOutput(false);
    }

Line 284: PrintWriter out = new
PrintWriter(getConnectionStream(theConnection));

Line 313: out.print(queryString.toString());
          out.close();

-Vincent

> -----Original Message-----
> From: Larry Isaacs [mailto:Larry.Isaacs@sas.com]
> Sent: 07 February 2002 15:43
> To: Tomcat Developers List
> Subject: RE: Tomcat 3.3 - Cactus Issue
> 
> Thanks for the info.  However, I never found where
> testPostMethod was using any POST data in the request.
> I only see:
> 
>     public void beginPostMethod(WebRequest theRequest)
>     {
>         theRequest.addParameter("param", "value",
WebRequest.POST_METHOD);
>     }
> 
> Is there some place I'm not looking where POST data is
> added as part of the client handling for this test?
> 
> Cheers,
> Larry
> 
> 
> > -----Original Message-----
> > From: Vincent Massol [mailto:vmassol@octo.com]
> > Sent: Thursday, February 07, 2002 10:15 AM
> > To: 'Tomcat Developers List'
> > Subject: RE: Tomcat 3.3 - Cactus Issue
> >
> >
> >
> >
> > > -----Original Message-----
> > > From: Larry Isaacs [mailto:Larry.Isaacs@sas.com]
> > > Sent: 07 February 2002 14:16
> > > To: 'Tomcat Developers List'
> > > Subject: RE: Tomcat 3.3 - Cactus Issue
> > >
> > > For the testPostMethod test, can you point me to where in
> > > Cactus, the POST data is added/generated and where in the
> > > server side code it is read.
> > >
> >
> > On the client side,
> > org.apache.cactus.client.HttpClientHelper.addParametersPost()
> >
> > On the server side, the POST parameters are not read by Cactus
itself
> > (Cactus is transparent in that regards). Cactus does pass
> > some internal
> > parameters (like class name, method name, etc) but always in the
URL.
> > These are read using the
> > org.apache.cactus.server.ServletUtil.getQueryStringParameter()
> >
> > The test cases read parameters the way they want (usually using
> > request.getParameter()). However, the testPostMethod() test
> > do not read
> > the POST parameter.
> >
> > > Does the latest 3.3.1-dev still fails on your laptop in
> > > spite a recent change to dump unread charecters?
> > >
> >
> > I've just tried with the nightly build from 6/02/2002 and it
> > still fails
> > (I tried 3 times and it failed on the third try).
> >
> > > Thanks.
> > >
> > > Larry
> > >
> 
> --
> To unsubscribe, e-mail:   <mailto:tomcat-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-dev-
> help@jakarta.apache.org>
> 




--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message