Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

empty body TLD & doStartTag return value

 
Radmika Arunachalam
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic