Doesn't matter, the JSTL spec says that the iteration tags should work with Maps, as well as arrays and instances of the Collection interface.
Thomas Gideon Sr. Software Developer B2eMarkets 301.230.2236 Tel. 301.230.2248 Fax. [EMAIL PROTECTED] www.B2eMarkets.com > -----Original Message----- > From: Roberto Mannai [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 09, 2002 2:26 PM > To: Tag Libraries Users List > Subject: Re: JSTL and HashMap: How does it work? > > > I don't know JSTL, but Hashmap does not implement > Collection interface. > Regards, > Roberto > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, October 09, 2002 8:02 PM > Subject: JSTL and HashMap: How does it work? > > > > Hi all > > > > According to the documentation, it's possible to get data > from a HashMap > in > > JSTL. Unfortunately, it doesn't really work for me... > > > > Here's the deal: A stock has a collection of charts, thus: > > > > stock.numberOfCharts = <c:out value="${stock.numberOfCharts}"/><br> > > stock.charts = <c:out value="${stock.charts}"/> > > <c:forEach var="chart" items="${stock.charts}"> > > <br>-> chart = <c:out value="${chart}"/> > > </c:forEach> > > > > results in > > > > stock.numberOfCharts = 9 > > stock.charts = > {1M=ch.xobix.contentgroup.controller.ImageWrapper@f6ae1c, > > 2M=ch.xobix.contentgroup.controller.ImageWrapper@20d6b7, > > 3M=ch.xobix.contentgroup.controller.ImageWrapper@f08d0f, > > 6M=ch.xobix.contentgroup.controller.ImageWrapper@bcfa38, > > 1Y=ch.xobix.contentgroup.controller.ImageWrapper@cfaf6e, > > 2Y=ch.xobix.contentgroup.controller.ImageWrapper@6989e, > > 3Y=ch.xobix.contentgroup.controller.ImageWrapper@dd7a7, > > 5Y=ch.xobix.contentgroup.controller.ImageWrapper@c94114, > > YTD=ch.xobix.contentgroup.controller.ImageWrapper@cf9bf0} > > -> chart = 1M=ch.xobix.contentgroup.controller.ImageWrapper@f6ae1c > > -> chart = 2M=ch.xobix.contentgroup.controller.ImageWrapper@20d6b7 > > -> chart = 3M=ch.xobix.contentgroup.controller.ImageWrapper@f08d0f > > -> chart = 6M=ch.xobix.contentgroup.controller.ImageWrapper@bcfa38 > > -> chart = 1Y=ch.xobix.contentgroup.controller.ImageWrapper@cfaf6e > > -> chart = 2Y=ch.xobix.contentgroup.controller.ImageWrapper@6989e > > -> chart = 3Y=ch.xobix.contentgroup.controller.ImageWrapper@dd7a7 > > -> chart = 5Y=ch.xobix.contentgroup.controller.ImageWrapper@c94114 > > -> chart = YTD=ch.xobix.contentgroup.controller.ImageWrapper@cf9bf0 > > > > which is fine. However, how can I address one entry? > > If I try > > > > chart = <c:out value="${stock.charts["1M"]}"/> > > > > I get > > > > javax.servlet.ServletException: /jsp/financialdata/show.jsp(33,40) > Attribute > > 1M has no value > > > > By the way, my getCharts() returns a LinkedHashMap (I > wanted the same > > sequence as when I inserted the objects). Theoretically, > shouldn't I be > able > > to traverse it like e.g. an ArrayList? > > > > chart[0] = <c:out value="${stock.charts[0]}"/> > > > > doesn't give me anything, though... > > > > > > Best regards, > > Eric > > > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>