Hi,

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."

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.

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.

Interestingly, JRun3.0 has the opposite bug, and doesn't call setBodyContent 
if the tag doesn't have a body but could.

Eg, in JRun the following action breaks:

<util:include url="foo.html"/>

But this works:

<util:include url="foo.html"></util:include>

The taglib in question is from the Jakarta Taglibs project.

Regards,

--Jeff

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to