aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
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
Author

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

Thanks
Radmika
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

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"

Thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: empty body TLD & doStartTag return value