tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rabe <>
Subject Taglib lifecycle issues
Date Thu, 19 Jun 2003 23:20:47 GMT
I'm using Tomcat 4.1.24-LE-jdk14, and have written a simple taglib by
extending the TagSupport class. It basically works, but the lifecycle is
being handled differently than I expected. My tag has no body, and has one
required attribute. My JSP page contains several invocations, all with
different values for the attribute. I expected setPageContext() to be called
once, followed by a bunch of doStartTag() / doEndTag() calls, followed by
one release() call. Instead, setPageContext() is being called for each
invocation of my tag (followed by doStartTag() and doEndTag()). My release()
method is *never* called.

I'm basing my expectations on the JSP 1.2 spec, esp pp. 163-164, and the
discussion about "Tag handler life cycle and instance reuse" at

The two issues in my mind are: (a) Is this working according to spec?
Perhaps I misunderstood how it's supposed to work. and (b) Could this be
done more efficiently? Replacing several scriptlet method calls with a
taglib caused the JSP's class file to double in size.

The code that's being generated for the JSP includes a bunch of private
methods that look like this:
  private boolean _jspx_meth_xlate_get_61(javax.servlet.jsp.PageContext
          throws Throwable {
    JspWriter out = pageContext.getOut();
    /* ----  xlate:get ---- */
    com.eloquent.ecs.tags.xlate.EXlateTagGet _jspx_th_xlate_get_61 =
    int _jspx_eval_xlate_get_61 = _jspx_th_xlate_get_61.doStartTag();
    if (_jspx_th_xlate_get_61.doEndTag() ==
      return true;
    return false;

Thanks for any insights you can provide.

Daniel Rabe
Eloquent, Inc.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message