tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: Looping with paramValues
Date Tue, 14 Sep 2004 19:18:24 GMT
I was thinking more along the lines of the HTTP spec not guaranteeing the order.
So that if you made the same request with parameters "foo" and "bar", in some
cases "foo" might be first and in other cases it might be "bar".

Quoting Martin Cooper <mfncooper@gmail.com>:

> On Tue, 14 Sep 2004 13:31:22 -0400, Kris Schneider <kris@dotech.com> wrote:
> > Well, even if you could do it cleanly, there's no guarantee on the ordering
> of
> > request parameters.
> 
> Although the Servlet spec doesn't state it explicitly, it does
> actually specify that the order of values for a given parameter, as
> returned by getParameterValues(), is the same as the order in which
> they are submitted.
> 
> --
> Martin Cooper
> 
> 
> > Are you really just checking to see if a particular
> > parameter has been passed? If so, you should be able to do that with just:
> > 
> > <c:if test="${param.nameOfTheParameter}">
> >  ...
> > </c:if>
> > 
> > Quoting Nic Werner <nic.werner@sonoma.edu>:
> > 
> > > Thanks everyone for the help. I ended up taking your examples, and just
> > > 'on the side' iterating through the paramValues until I found the
> > > matching one, and then setting a temp flag. Its unfortunate that I
> > > couldn't just use an index to access the nth param and its nth value.
> > >
> > > - Nic.
> > >
> > > Helios Alonso wrote:
> > >
> > > > Oops.  Exactly.
> > > >
> > > > At 11:56 13/09/2004 -0400, you wrote:
> > > >
> > > >> Helios,
> > > >>
> > > >> Small correction (I think), did you mean ...
> > > >> ><c:forEach var='entry' items='${params}'>
> > > >> >   <c:if test="${entry.key == 'test1'>
> > > >> >     <c:out value="${entry.value}"/>
> > > >> >   </c:if>
> > > >> ></c:forEach>
> > > >> Note: I switched var and items values.
> > 
> > -- 
> > Kris Schneider <mailto:kris@dotech.com>
> > D.O.Tech       <http://www.dotech.com/>

-- 
Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message