|
----- Original Message -----
Sent: Tuesday, May 22, 2001 4:29 PM
Subject:
{cactus}ServletTestRequest::addParameter help
Can someone please answer a couple questions regarding the
Cactus architecture?
I am writing a test suite to test a data
validation routine in my servlet. I am passing a number of parameters in a
single request. For each test, I want to send one of the parameters with
invalid data.
I created a function that uses the ServletTestRequest's
addParameter method to initially set up valid default parameters for each
data item. For each test in the suite, I want to reset to invalid data the
single item being tested. Unfortunately, there does not appear to be
a method for setting, changing, or removing a parameter from the
request once it has been added.
I am not sure I understand. What I can tell
you is that each test is independant of another, including the
ServletTestRequest object (if it is not, then it's a bug !). And hte beginXXX()
method is provided to set the paramters and others. On the server side you get
these values using the request. Where would you want to modify/delete these
parameters ?
Is there a reason that this
functionality is not provided? Also, according to the documentation, it is
possible to add the same parameter name several times to the request. Under
what circumstances would someone want to do this? Can you give me an
example? I appreciate any help you can give.
Accepting several parameters with the same
name is a requirements of the HTTP 1.1 specifications. It is used when sending a
combo data for instance. The combo has an id/name and several
values.
Vincent.
|