You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Abdullah Jibaly <Ab...@aeroxchange.com> on 2005/04/13 22:04:30 UTC

RE: forEach> for an object that extends ArrayList in Application **and** Session

try:

<c:forEach items="${sessionScope['userPortfolios']}" var="p">
	<c:out value="${p.portfolioName}" />
</c:forEach>

-Abdullah

-----Original Message-----
From: David Johnson [mailto:chachany@gmail.com]
Sent: Wednesday, April 13, 2005 2:46 PM
To: Struts Users Mailing List
Subject: Re: forEach> for an object that extends ArrayList in
Application **and** Session


Oh, and to answer the other question, I stored the
PortfolioBeanCollection on the session under the key

"userPortfolios" like this:

PortfolioBeanCollection myPortfolios= loadUserPortfolios(userID);
session.setAttribute("userPortfolios",myPortfolios);

On 4/13/05, David Johnson <ch...@gmail.com> wrote:
> that makes sense, but the individual portfolios (the members of the
> PortfolioBeanCollection) dont really have a name, I just looped
> through my result set doing
> 
> PortfolioBeanCollection PBC=new PortfolioBeanCollection ();
> while (result.hasnext){
> pbc.add (new PortfolioBean(resultSet.getString("namefield")));
> }
> 
> so I really just used the PortfolioBeanCollection as if it were a
> garden variety ArrayList.... does your comment still apply?
> 
> On 4/13/05, Dave Newton <ne...@pingsite.com> wrote:
> > David Johnson wrote:
> >
> > ><c:forEach var="portfolio" items="${userPortfolios}">
> > >     <c:out value="${portfolioName}"/><br>
> > ></c:forEach>
> > >
> > >it outputs the proper number of <br> tags, but is not preperly
> > >displaying the correct PortfolioBeanCollection.PortfolioBean.portfolioName
> > >
> > >
> > You're not specifying the bean from which to get the property.
> >
> > <c:out value="${portfolion.portfolioName}"/>
> >
> > Dave
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> --
> -Dave
> ChaChaNY@Gmail.com
> 


-- 
-Dave
ChaChaNY@Gmail.com

---------------------------------------------------------------------
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


Re: forEach> for an object that extends ArrayList in Application **and** Session

Posted by David Johnson <ch...@gmail.com>.
bingo, that was it. Thank you!

On 4/13/05, Abdullah Jibaly <Ab...@aeroxchange.com> wrote:
> try:
> 
> <c:forEach items="${sessionScope['userPortfolios']}" var="p">
>        <c:out value="${p.portfolioName}" />
> </c:forEach>
> 
> -Abdullah
> 
> -----Original Message-----
> From: David Johnson [mailto:chachany@gmail.com]
> Sent: Wednesday, April 13, 2005 2:46 PM
> To: Struts Users Mailing List
> Subject: Re: forEach> for an object that extends ArrayList in
> Application **and** Session
> 
> Oh, and to answer the other question, I stored the
> PortfolioBeanCollection on the session under the key
> 
> "userPortfolios" like this:
> 
> PortfolioBeanCollection myPortfolios= loadUserPortfolios(userID);
> session.setAttribute("userPortfolios",myPortfolios);
> 
> On 4/13/05, David Johnson <ch...@gmail.com> wrote:
> > that makes sense, but the individual portfolios (the members of the
> > PortfolioBeanCollection) dont really have a name, I just looped
> > through my result set doing
> >
> > PortfolioBeanCollection PBC=new PortfolioBeanCollection ();
> > while (result.hasnext){
> > pbc.add (new PortfolioBean(resultSet.getString("namefield")));
> > }
> >
> > so I really just used the PortfolioBeanCollection as if it were a
> > garden variety ArrayList.... does your comment still apply?
> >
> > On 4/13/05, Dave Newton <ne...@pingsite.com> wrote:
> > > David Johnson wrote:
> > >
> > > ><c:forEach var="portfolio" items="${userPortfolios}">
> > > >     <c:out value="${portfolioName}"/><br>
> > > ></c:forEach>
> > > >
> > > >it outputs the proper number of <br> tags, but is not preperly
> > > >displaying the correct PortfolioBeanCollection.PortfolioBean.portfolioName
> > > >
> > > >
> > > You're not specifying the bean from which to get the property.
> > >
> > > <c:out value="${portfolion.portfolioName}"/>
> > >
> > > Dave
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> > --
> > -Dave
> > ChaChaNY@Gmail.com
> >
> 
> --
> -Dave
> ChaChaNY@Gmail.com
> 
> ---------------------------------------------------------------------
> 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
> 
> 


-- 
-Dave
ChaChaNY@Gmail.com

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