Hi Ross,

> I'm trying to use the stripes:link tag to produce a link that calls a
> search event that handles multiple criteria. These links are essentially
> shortcuts that perform common searches by enabling certain criteria (and
> values) with URL parameters.
> 
> <stripes:link ...>
>    <stripes:param name="searchRequest.criteria" value="foo"/>
>    <stripes:param name="searchRequest.criteria" value="bar"/>
>    ....
> </stripes:link>
> 
> This is not working quite the way I expected. The resulting URL only has
> a single "searchRequest.criteria" parameter.
> 
> Just wondered if this was a bug or expected behavior?

I believe this is the expected behavior. To have multiple values for the
same parameter name, you need to use one param tag and use a collection
or array for the value.

> Is there a way to create this collection on the fly with an EL
> expression?

My preference would be to obtain the collection from the action bean,
but, off the top of my head, I would think you could create the
values in the JSP with something like:

<% request.setAttribute("values", new String[] {"foo", "bar"}); %>
<stripes:link ...>
  <stripes:param name="searchRequest.criteria" value="${values}"/>
</stripes:link>

Hope that helps.

Cheers,
Freddy
http://www.stripesbook.com

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to