views:

38

answers:

1

Hello,

I would like to create a really simple tag parameterized with a collections' ids something like the following:

<s:url action="theaction" namespace="/" includeParams="all" id="histURL">
 <s:param name="sources" value="sources.{id}"></s:param>
</s:url>
${histURL}

If I have say three Source objects defined in my Action class, having ids 1,2 and 3 then I assume, the histURL output will be sg like:

http://localhost:8080/myproject/theaction&amp;sources=1&amp;sources=2&amp;sources=3

But it does not work, it displays:

http://localhost:8080/myproject/theaction

Another hint:

<s:url action="theaction" namespace="/" includeParams="all" id="histURL">
 <s:param name="sources" value="sources"></s:param>
</s:url>
${histURL}

results in

http://localhost:8080/myproject/theaction&amp;sources=com.mycompany.Source@32324&amp;sources= ...

So the collection as a paramater works, I just assumed that the OGNL projection works well but seems to be buggy. Or am I missing something? Is this OGNL at all? :)

Thank you for your replies!

+1  A: 

I'm dumb. This is just the way, I missed that I used a wrong class, which had no Id at all. It's definitely OGNL and it works like charm :)

Balint Pato