Tomcat 4.0 follows the JSP 1.2 specification and does not call
setBodyContent(), doInitBody() and doAfterBody() on empty tags (tags with no
body).
Be careful with spaces, they are considered significant in JSP syntax and
constitute a tag body.
Justy
> This is an area where the JSP 1.1 specification is not clear, so
unfortunately
> different containers deal with <tag/>, <tag></tag> and <tag>foo</tag>
> differently.
> More specifically, they differ in under what circumstances they call
> setBodyContent() and doInitBody().
>
> Tomcat (and some others) invokes these methods for all cases (as long as
> doStartTag() doesn't return SKIP_BODY). Others invoke them only for the
second
> case and/or third case (i.e. when an opening and closing tag are used).
>
> A common problem in a tag handler that assumes them to always be invoked
is
> using the bodyContent variable in doEndTag() without checking for null,
leading
> to a NullPointerException in a container.
>
> This has been discussed in the JSP specification expert group and it will
> be clarified in JSP 1.2 as follows:
>
> <tag/>, <tag /> and <tag></tag> are all equal, and are called an "empty
> tags" ("empty *elements*" would have been better ...).
>
> <tag> </tag>, <tag><%= foo %></tag>, <tag>foo</tag> etc. are all
"non-empty"
>
> The container will only call setBodyContent() and doInitBody() for
non-empty
> tags, and only the BodyTag.doStartTag() returns EVAL_BODY_BUFFER.
>
> So, given this, WebLogic is doing the right thing in your case while
Tomcat is
> not (it's a known bug in Tomcat 3.2.1, but it may have been fixed in later
> versions).
>
> > [...]
>
> Hans
> --
> Hans Bergsten [EMAIL PROTECTED]
> Gefion Software http://www.gefionsoftware.com
> Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets