tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Bergsten <h...@gefionsoftware.com>
Subject Re: JSP doInitBody/doAfterBody with no body
Date Wed, 14 Mar 2001 20:47:42 GMT
Marc Saegesser wrote:
> 
> The follow email discussion happened on tomcat-dev back in January.  In
> reviewing the open bugs for Tomcat 3.2.2 I came across this issues again and
> I'm trying to decide if it should dealt with, marked invalid, etc.
> 
> Did anyone hear anything back from jsp-comments?  For that matter, has any
> *ever* heard anything back from jsp-comments?  I've never received a single
> response to any message I've ever sent to that address.

I brought this to the JSR-053 working group yesterday, and Eduardo has
promised to try to resolve the issue with a mail today or tomorrow.

My reading of the spec, though, is that no matter if an action element has
a body or not, all body methods must always be called if BodyTag is implemented.
Not doing so means that the tag developer needs to deal with different
usage scenarios in the code, and that should not be necessary.

Hans

> ------------------
> 
> Jeff Turner wrote:
> > Having a look through bug 652:
> >
> >  BodyTag doInitBody and doAfterBody called on tags without body
> >
> > (http://znutar.cortexity.com/BugRatViewer/ShowReport/652)
> >
> > I don't think this is a bug.
> >
> > The JSP spec, p88, says:
> >
> > "If an action element can have a non-empty body and is
> > interested in the content of that body, the methods doInitBody() and
> > doAfterBody(), defined in the BodyTag interface are involved."
> 
> My interpretation of this is:
> * Tag "foo" may have body
> * <x:foo>Blah</x:foo> -> body methods called
> * <x:foo/> -> no body methods called
> 
> > Note, "can have", not "if it does have". So an element without a body, but
> > that *could* have a body according to the TLD, still has do*Body methods
> > called.
> 
> .. if it has a body *in the usage of it*, sure. Of course. But if it's
> not *used* with a body, then the body methods should not be called.
> 
> > So:
> >  <my:tag>foo</my:tag> has do*Body() called (obviously).
> >  <my:tag></my:tag> has do*Body() called (the body will just be blank)
> >  <my:tag/> has do*Body() called, because according to the XML spec, this
> is
> > shorthand for the <my:tag></my:tag> notation, and therefore processes
> > equivalently.
> 
> I see the two last ones as distinctly different, whereas the first two
> are identical semantically. And I have a couple of tags that indeed
> makes a major difference between <x:foo></x:foo> and <x:foo/>.
> 
> > Interestingly, JRun3.0 has the opposite bug, and doesn't call
> setBodyContent
> > if the tag doesn't have a body but could.
> 
> To me that is correct.
> 
> > Eg, in JRun the following action breaks:
> >
> > <util:include url="foo.html"/>
> 
> Why? How is this tag dependent on a body to be supplied?
> 
> > But this works:
> >
> > <util:include url="foo.html"></util:include>
> >
> > The taglib in question is from the Jakarta Taglibs project.
> 
> To me this hints at a bug in the Jakarta Taglibs.
> 
> It might be beneficial to send a query about this to the JSP spec
> writers, since it's a rather important issue. I have CC'ed
> jsp-spec-comments@eng.sun.com.
> 
> regards,
>   Rickard
> 
> --
> Rickard Öberg
> 
> Email: rickard@jboss.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org

-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org


Mime
View raw message