You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Rocks <ro...@hotmail.com> on 2009/09/20 11:28:56 UTC
Iterator cannot populate param tag inside URL
Here is an interesting one, I have a collection of params I wish to inject into a URL dynamically.
I have a simple name value pair class that are stored in the extraArgs list
I can print out the extra tags on the page quite happily...
<s:iterator value="#attr.info.extraArgs" status="arg" >
<s:property value="name" />,<s:property value="value" />
</s:iterator>
But when I go to try and slot them into a URL as params it does not work..
<aa hhref="<s:url action="%{#attr.info.baseUrl}" includeParams="none" >
<s:iterator value="#attr.info.extraArgs" status="arg" >
<s:param name="<s:property value='name' />" value="<s:property value='value' />" />
</s:iterator>
<s:param name="page" value="%{#attr.page}" />
</s:url>">${page}</aa>
(intentional spelling mistakes in the a tag)
The params just do not seem to come through. I'll probably knock this up with a scriptlet but bit annoyed as I think it should work.
Struts 2.1.6
_________________________________________________________________
Lauren found her dream laptop. Find the PC that’s right for you.
http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290
Re: Iterator cannot populate param tag inside URL
Posted by Paweł Wielgus <po...@gmail.com>.
Hi David,
You are nesting tags, which is not possible/permitted.
Try to do something like < s:param name="name" value="value"/> inside
an iterator.
Should work.
Best greetings,
Pawel Wielgus.
2009/9/20, David Rocks <ro...@hotmail.com>:
>
> Here is an interesting one, I have a collection of params I wish to inject
> into a URL dynamically.
>
>
>
> I have a simple name value pair class that are stored in the extraArgs list
>
>
>
> I can print out the extra tags on the page quite happily...
>
>
>
>
>
> <s:iterator value="#attr.info.extraArgs" status="arg" >
> <s:property value="name" />,<s:property value="value" />
> </s:iterator>
>
>
>
> But when I go to try and slot them into a URL as params it does not work..
>
>
>
>
>
> <aa hhref="<s:url action="%{#attr.info.baseUrl}" includeParams="none" >
>
> <s:iterator value="#attr.info.extraArgs" status="arg" >
>
> <s:param name="<s:property value='name' />" value="<s:property
> value='value' />" />
>
> </s:iterator>
>
> <s:param name="page" value="%{#attr.page}" />
>
> </s:url>">${page}</aa>
>
>
>
> (intentional spelling mistakes in the a tag)
>
>
>
> The params just do not seem to come through. I'll probably knock this up
> with a scriptlet but bit annoyed as I think it should work.
>
>
>
> Struts 2.1.6
>
>
>
>
>
>
>
>
>
> _________________________________________________________________
> Lauren found her dream laptop. Find the PC that’s right for you.
> http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org