tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konrad <khgus...@yahoo.com>
Subject [General TagLib question] Custom TagLib storing value in PageContext/session and reference by Standard JSTL?
Date Thu, 15 Jan 2004 21:17:19 GMT
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));
}


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: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message