----- Original Message -----
From: "Catherine Jung" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 09, 2001 11:30 AM
Subject: Servlet Request Parameters
> Hi,
> Further investigation of the problem I was having with request
> parameters not seeming to be passed on has lead me to discover the
> following:
>
> If you set a parameter using the addParameter method, you can
> retrieve it again using getParameter, but it doesn't appear on the query
> string (fair enough - they'll be being POSTed instead)
true. However you can choose the method used (POST or GET) by calling
ServletTestRequest.setMethod().
>
> If you set a list of parameters using the setURL method, you can get
> them back using getQueryString, BUT, not using getParameter. This I find a
> little strange, and means that I have to set the parameter twice - once in
> the query string (that I use as a key for my cache) and once using
> setParameter so I can actually use it!
It is supposed to work as you described it. I just found why it doesn't for
you. It is a change that has been made in version 1.2 in CVS and you are
probably using the latest released version (1.1).
Here is the description of the change (on
http://jakarta.apache.org/commons/cactus/changes.html) :
"Now all HTTP parameters specified in the URL when using the
ServletTestRequest.setURL() method are automatically passed as real HTTP
parameters to the server side, meaning you don't have to manually call
addParameters(). (VMA) Thanks to Jari Worsley. "
Normally you would be able to easily grab a nightly build except that they
are not working yet for Servlet API 2.2. However if you are using Servlet
API 2.3 you can get them on the Cactus download page. For Servlet API 2.2,
you'll have to build from the sources. Tell me if this is a problem and I'll
build it manually for you and put it in the nightly build area.
>
> Is this the correct behaviour? Or am I missing something?
>
> Catherine
Thanks and sorry for that
P.S.: Have a look at the javadoc, you'll find the list of the methods that
are available for ServletTestRequest and other objects.
-Vincent