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 Regarding Tags & tld 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 "Regarding Tags & tld" Watch "Regarding Tags & tld" New topic

Regarding Tags & tld

Vedhas Pitkar
Ranch Hand

Joined: Jan 27, 2001
Posts: 445
Hi ranchers!Got a bit of problem in return type of tag methods.It states in the JSP1.2 Spec (pg 164 Tag Extension API) that
" If the TagLibraryDescriptor file indicates that the action must always have an
empty action, by an <body-content> entry of “empty”, then the doStartTag()
method must return SKIP_BODY. Otherwise, the doStartTag() method may
But if I try it out ie an empty tag & make the doStartTag() return EVAL_BODY_INCLUDE,then the code gives me no problem.
Also ,those of you who have the Manning book,their in chapter16 has following code :
if (condition)
return SKIP_BODY;
& the tld file has the <body-content> for that tag as empty.
Why is this so?
Also,if i put some junk values for the <body-content>(or for anthing in the tld)
ie <body-content>12345</body-content>
then it gives me no error & accepts the default value "jsp".
Any answers?
Vedhas Pitkar
Ranch Hand

Joined: Jan 27, 2001
Posts: 445
Whaaaaaaat? No answers?
k space
Ranch Hand

Joined: Jun 25, 2002
Posts: 104
Don't rely too much on the behaviour of Tomcat, the exam is not testing your knowledge of Tomcat.
Check Chawla's mock: default body-content
Some Web containers are very tolerant.

SCEA | SCBCD | SCWCD | SCJP - The kSpace
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
Vedhas, you're exactly right in that Tomcat is fairly lenient in this respect. I've been playing with Tomcat 5 recently and it's still the same.
I agree. Here's the link:
subject: Regarding Tags & tld
It's not a secret anymore!