"Konrad" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello. > > In my custom taglib's doStartTag() method, I stored a > value in the session, as follows: > > CustomTag > ========= > public void doStartTag() { > > > this.pageContext.getSession().setAttribute("endIdx",new > Integer(9));
Try this instead: pageContext.setAttribute("endIdx", new Integer(9), PageContext.SESSION_SCOPE); -- Martin Cooper > } > > > I am trying to reference that value in JSTL's > <c:forEach> tag, as in the following .jsp snippet: > > > test.jsp > ======== > > <my:custom/> <!-- just calls/executes the CustomTag > --> > > <c:forEach var="card" items="${cards}" begin="0" > end="${endIdx}"> > <c:out value="${card.name}"/> > </c:forEach> > > > Basically, above, I am trying to dynamically set the > ending index of the forEach tag, based on the value > calculated in CustomTag. > > However, forEach's "end" attribute is resolving to 0 > instead of 9, which was set in the CustomTag's > doStartTag() method. > > Is there a way to ensure that CustomTag executes "in > advance" such that forEach's "end" tag can correctly > reference the value set in the session? > > Thank you. > > > __________________________________ > Do you Yahoo!? > New Yahoo! Photos - easier uploading and sharing. > http://photos.yahoo.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]