You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Russ Bonsall <rb...@computer-guidance.com> on 2002/10/08 19:44:30 UTC

Request parameters not coming through correctly [Tomcat 4.1.12]

I am having a problem in Tomcat 4.1.12 that I did not have in Tomcat 4.0.4.
I have a jsp that has two forms.  Both forms have the same name and use most
of the same parameters.  The first form has a drop-down("searchField") and a
textfield("searchString").  In Tomcat 4.0.4 these values came through fine.
In Tomcat 4.1.12 the values are coming through in the request, but they are
the second element in a String array.  In other words, to get the values out
I have to do something like the following:

String searchFields[] = request.getParameterValues("searchField");
String searchFieldValue = searchFields[1]; 

I should be able to just do:
String searchFieldValue = request.getParameter("searchField");


Why would I be getting an array with two values?  I was able to get the form
to work if it was the only thing in the jsp, so I believe there is something
external to the form being picked up as an additional parameter, but I can't
figure it out.  Any ideas?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Request parameters not coming through correctly [Tomcat 4.1.12]

Posted by Remy Maucherat <re...@apache.org>.
Russ Bonsall wrote:
> I am having a problem in Tomcat 4.1.12 that I did not have in Tomcat 4.0.4.
> I have a jsp that has two forms.  Both forms have the same name and use most
> of the same parameters.  The first form has a drop-down("searchField") and a
> textfield("searchString").  In Tomcat 4.0.4 these values came through fine.
> In Tomcat 4.1.12 the values are coming through in the request, but they are
> the second element in a String array.  In other words, to get the values out
> I have to do something like the following:
> 
> String searchFields[] = request.getParameterValues("searchField");
> String searchFieldValue = searchFields[1]; 
> 
> I should be able to just do:
> String searchFieldValue = request.getParameter("searchField");
> 
> 
> Why would I be getting an array with two values?  I was able to get the form
> to work if it was the only thing in the jsp, so I believe there is something
> external to the form being picked up as an additional parameter, but I can't
> figure it out.  Any ideas?

Yes, the spec was undefined about that, and there was no test in the 
reference test suite either. It got "standardized" on Tomcat 4.1, in the 
end (as I understand it).

Remy


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>