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 Am I correct about body-content ??? 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 "Am I correct about body-content ???" Watch "Am I correct about body-content ???" New topic

Am I correct about body-content ???

Giju George
Ranch Hand

Joined: Jun 08, 2004
Posts: 333
For tag files:-

Default:- scriptless

For Simple Tags:-

Default:- scriptless

For Custome tags:-

Default:- JSP

SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCEA
vanam kris

Joined: Nov 19, 2004
Posts: 12
Yes that's correct
Gabriel Forro
Ranch Hand

Joined: Apr 16, 2004
Posts: 59

I think, You are not correct regarding simple and classic custom tags.

In the JSP 2.0 spec the <body-content> element is mandatory in the tld file for the simple ang classic custom tags. So there is no default value.

taty gora

Joined: Nov 29, 2004
Posts: 16
Hi ,
I think,

For Simple Tags and Classic Tags default is
taty gora

Joined: Nov 29, 2004
Posts: 16
I didn't find default for the <body-content> in JSP 2.0 specs.
It should depend on implementation.

Krzysiek Hycnar
Ranch Hand

Joined: Jan 02, 2004
Posts: 74
And the winner is.. Giju George

You're right!! This is a kind of subtelty worth to remember.
You don't have to specify the <body-content> for Classic Tags, however you must specify <body-content> for Simple Tags and it cannot be JSP (the default value is JSP, if you don't type it explicite you get the default value). I wrote about it replying go Jean's post (can be found here)

So Gabriel, either you're wrong or Tomcat 5.x does not fully support JSP 2.0. Just think, how stupid would be of the specs creators be to make the <body-content> mandatory in JSP 2.0. There are plenty of web apps that sonner or later will be ported to containers that support JSP 2.0, and all of the tlds in all of them would have to be changed to explicitly state what content the tags deal with (in pre 2.0 spec the <body-content> was NOT mandatory)

Gabriel Forro
Ranch Hand

Joined: Apr 16, 2004
Posts: 59

Tomcat is a very friendly container. The XML validation is switched off by default. If You check the
xml schema, You can notice, that the body-content is not an optional element.
In my opinion if You use <taglib ... version="2.0">, than there is no default value for the classic and simple tags, as the tld file is invalid without a <body-content> element.

The body-content element's definition from the

If You use older version of tld (validated by
), where You can use only classic tags, then the default value is JSP. This is the case for older tag libaries.

For the 1.4 exam You have to know the JSP 2.0 spec.
[ December 15, 2004: Message edited by: Gabriel Forro ]
I agree. Here's the link:
subject: Am I correct about body-content ???
It's not a secret anymore!