You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Johnson, Kaerstin" <kj...@systechnologies.com> on 2005/08/12 23:11:29 UTC

accessing a collection

I have some code that access a collection from the bean using
request.getAttribute(myAttributeName); 

I'd like to access it using the form directly or jstl and then iterate
over it. 

Whats the bets way to do this?



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


Re: accessing a collection

Posted by Dave Newton <ne...@pingsite.com>.
Johnson, Kaerstin wrote:

>I have some code that access a collection from the bean using
>request.getAttribute(myAttributeName); 
>
>I'd like to access it using the form directly or jstl and then iterate
>over it. 
>
>Whats the bets way to do this?
>  
>
<c:forEach items="${myAttributeName}" var="item">
  <c:out value="${item.itemProperty}"/>
  <!-- ... -->
</c:forEach>

Don't forget the JSP taglib directive and make sure you have the JSTL libs.

Dave



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