File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes empty body TLD & doStartTag return value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "empty body TLD & doStartTag return value" Watch "empty body TLD & doStartTag return value" New topic

empty body TLD & doStartTag return value

Radmika Arunachalam
Ranch Hand

Joined: Mar 29, 2004
Posts: 45
In HFSJ pg 534 given
if TLD declares an empty body, doStartTag must return SKIP_BODY..
But i tested in Tomcat 5.0.28.. It is not giving any error.. Here is my code

tld file

java file

JSP file

I am getting following output in TOMCAT

Is this bug in TOMCAT or bug in HFSJ? Anyone know what is in SPEC? Help me please

Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 951

If you look into the JSP spec, there are actually two statements.

If the TagLibraryDescriptor file indicates that the action must always have an empty element body, by a <body-content> entry of "empty", then the doStartTag() method must return SKIP_BODY.

Note that which methods are invoked after the doStartTag() depends on both the return value and on if the custom action elements is empty or not in the JSP page, not on how it's declared in the TLD

Not easy to understand for me but point out that doStartTag() can have other value when the body-conetent is "empty"


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
I agree. Here's the link:
subject: empty body TLD & doStartTag return value
jQuery in Action, 3rd edition