struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Lulé <tho...@lule.fr>
Subject Re: Iterate over an ArrayList of arrays
Date Tue, 11 May 2010 10:05:47 GMT
It works !

Thank you very much.

2010/5/11 Steven Yang <kenshin520@gmail.com>:
> try
> <s:iterator value="breadcrumbs">
>                       <li><a href="${top[1]}">${top[0]}</a></li>
>               </s:iterator>
>
> On Tue, May 11, 2010 at 5:52 PM, Thomas Lulé <thomas@lule.fr> wrote:
>
>> I just found an ugly solution :
>>
>>        <ul>
>>                <s:iterator value="breadcrumbs">
>>                         <s:iterator status="stat">
>>                                <s:if test="#stat.index==0">
>>                                        <s:set name="text"><s:property
>> /></s:set>
>>                                </s:if>
>>                                <s:else>
>>                                        <s:set name="url"><s:property
>> /></s:set>
>>                                </s:else>
>>                        </s:iterator>
>>                        <li><a href="${url}">${text}</a></li>
>>                </s:iterator>
>>        </ul>
>>
>> 2010/5/11 Thomas Lulé <thomas@lule.fr>:
>> > Hi,
>> >
>> > I've got an ArrayList<String[]> named "breadcrumbs" in my action that
>> > I would like to display in my JSP.
>> >
>> > Something like :
>> >        <ul>
>> >                <s:iterator value="breadcrumbs">
>> >                        <li><a href="${value[1]}">${value[0]}</a></li>
>> >                </s:iterator>
>> >        </ul>
>> > I want to iterate over the ArrayList, then get the two values of the
>> > array, but this code obviously doesn't work.
>> >
>> > Do you have any better idea ?
>> >
>> > Thank you,
>> > Thomas
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>

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


Mime
View raw message