You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by TonyD <an...@eunics.it> on 2007/06/25 12:41:41 UTC
How to select the first item of a list.
I'm working with structs 2.0.6 and a populate a list of users from a
database.
How can I select the first item of the list (the first user) with a
value option?
Thanks for any help, regards
--
View this message in context: http://www.nabble.com/How-to-select-the-first-item-of-a-list.-tf3975318.html#a11284323
Sent from the Struts - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: How to select the first item of a list.
Posted by TonyD <an...@eunics.it>.
THANKS! IT WORKS!
Lukasz Racon wrote:
>
> It depends what you have as an underlaying collection:
> users[0] in case of arrays, lists;
> or in worst case scenario use:
> users.{^ true==true}
>
> Check the OGNL:
> http://wiki.opensymphony.com/display/WW/OGNL
> http://wiki.opensymphony.com/display/WW/OGNL+Basics
>
> Lukasz
>
>
> TonyD wrote:
>>
>> I'm working with structs 2.0.6 and a populate a list of users from a
>> database.
>> How can I select the first item of the list (the first user) with
>> a value option?
>>
>>
>> Thanks for any help, regards
>>
>
>
--
View this message in context: http://www.nabble.com/How-to-select-the-first-item-of-a-list.-tf3975318.html#a11288114
Sent from the Struts - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: How to select the first item of a list.
Posted by Lukasz Racon <lu...@racon.pl>.
It depends what you have as an underlaying collection:
users[0] in case of arrays, lists;
or in worst case scenario use:
users.{^ true==true}
Check the OGNL:
http://wiki.opensymphony.com/display/WW/OGNL
http://wiki.opensymphony.com/display/WW/OGNL+Basics
Lukasz
TonyD wrote:
>
> I'm working with structs 2.0.6 and a populate a list of users from a
> database.
> How can I select the first item of the list (the first user) with
> a value option?
>
>
> Thanks for any help, regards
>
--
View this message in context: http://www.nabble.com/How-to-select-the-first-item-of-a-list.-tf3975318.html#a11287971
Sent from the Struts - Dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org