struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: A list-backed property...of a list-backed property?
Date Thu, 26 Apr 2007 03:01:04 GMT
Johngara wrote:
> I've been wondering this for a while but is it possible to index an list
> inside of a list?
> 
> ie.
> You can have a 1 layer list-backed property via
> 
> public void setFoo(int key, Object value) {
>         foo.set(key, value);
>     }
> 
>     public Object getFoo(int key) {
>         return foo.get(key);
>     }
> 
> and in your jsp, reference a foo[0], foo[1], etc.
> 
> But can you put another List<Object> inside of the Object itself and
> reference that in your jsp page at all?
> 
> Basically, what I would love to achieve is something like:
> <c:forEach var="fooer" items="foo">
>       <c:forEach var="fooerer" items="${fooer}">
>              ${fooerer[12]}
>       </c:forEach>
> </c:forEach>
> 
> any ideas or suggestions?

How about trying it? :-) It should work fine.

L.


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


Mime
View raw message