David Johnson wrote:

That totally makes sense, and I definitely see hot to iterate through
a collection of Strings or other straightforward things, but what I'm
confused about is that my PortfolioBeanCollection (extends ArrayList)
contains objects of type "PortfolioBean" which in  turn contain the
attribute I'm trying to display..so the PortfolioBean itself has no
explicit name to which I can refer...

so I really want to do something like

PortfolioBeanCollection.PortfolioBean.portfolioName

normally, I'd just loop through the PortfolioBeanCollection casting
the resulting Object into a PortfolioBean then calling the
getPortfolioName() method on the bean


You don't need to cast in JSTL; JSTL does the Right Thing.

You give it a collection ('items' attribute, in your case a PortfolioBeanCollection, which is a collection, regardless of whatever additional functionality you've given it), a name to call each object in the iteration ('var' attribute, say you call it "portfolio"), and go.

The c:out tag says "Oh, you want the 'portfolio.portfolioName' to print out," tries to call getPortfolioName() on whatever object you've given it (hopefully a PortfolioBean, otherwise it will throw an exception), and displays the results.

I don't think I can explain it any differently.

Good luck!

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to