aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes body-content default value question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "body-content default value question" Watch "body-content default value question" New topic
Author

body-content default value question

Frederic Esnault
Ranch Hand

Joined: Feb 13, 2006
Posts: 284
Hi all,

I have a question about custom tags body content.
In the spec it is said before JSP 2.0, default was JSP. But since it's an invalid value for simple tags, there is no default value.

So what if on the exam a question asks for the behavior of a tag with a body and gives a tld defining the tag with no body-content declared?

The scriptless body-content is said to be a reasonable default if the tag can have a body.

Should we assume it's scriptless? And what about classic tags default? JSP as in previous spec?


SCJP 5 - SCWCD 1.4 - SCBCD 1.3 - Certification study documents/resources: http://esnault.frederic.free.fr/certification
Chandra Sagi
Ranch Hand

Joined: May 05, 2005
Posts: 162
Originally posted by Frederic Esnault:
Hi all,

I have a question about custom tags body content.
In the spec it is said before JSP 2.0, default was JSP. But since it's an invalid value for simple tags, there is no default value.

So what if on the exam a question asks for the behavior of a tag with a body and gives a tld defining the tag with no body-content declared?

The scriptless body-content is said to be a reasonable default if the tag can have a body.

Should we assume it's scriptless? And what about classic tags default? JSP as in previous spec?


The book says that we do not know whether the tag is handled by a Classic tag handler or a Simple tag handler unless we know the class implements Tag interface or SimpleTag interface. We could even completely replace the class to use a SimpleTag without making any changes to the TLD. So, from this I think the default value for body-content in classic tags is also scriptless.

Thanks
Chandu
RamaKrishnan Narayanan
Greenhorn

Joined: Mar 07, 2006
Posts: 3
in HFSJ , it has been mentioned that body-content tag on the TLD is mandatory.
parra matta
Ranch Hand

Joined: Mar 23, 2006
Posts: 40
That's correct. You must specify the body-content. The 3 mandatory sub elements of tag are name, tag-class and body-content.
Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
Did anyone here get some question asking about the default value for <body-content> tag? If so, it asked for one or two answers? (JSP / scriptless) ??


SCJP | SCWCD | SCBCD | SCWSD 5 | SCEA (I) 1.4 | SCEA 5 | IBM SOA 669
Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
Originally posted by Frederic Esnault:
Hi all,

I have a question about custom tags body content.
In the spec it is said before JSP 2.0, default was JSP. But since it's an invalid value for simple tags, there is no default value.

So what if on the exam a question asks for the behavior of a tag with a body and gives a tld defining the tag with no body-content declared?

The scriptless body-content is said to be a reasonable default if the tag can have a body.

Should we assume it's scriptless? And what about classic tags default? JSP as in previous spec?




HI Frederic/All

I got this :

"SimpleTags" are commonly declared with <body-content> of "scriptless".

BUUUUTT

"There is **NO** default value for SimpleTags regarding its bodycontent type."


is it correct?

tks
Ganesh.P Ram
Ranch Hand

Joined: Dec 22, 2005
Posts: 41
Hi,
I found a similar question in j2eecertificate.
There I remember reading that the body-content is not mandatory and it defaults it to JSP.

btw, simple tags cannot have JSP body-content bcos they cant have scripting expressions in their body - is that right ??


Ganesh
Steven Colley
Ranch Hand

Joined: Feb 18, 2005
Posts: 290
HI Ganesh,

The j2eecertiface is related to 1.3 exam.

So,

- default value for ClassicTag - JSP
- default value for SimpleTag - none (commonly used with scriptless).

is it correct?
david.co diaz
Greenhorn

Joined: Sep 11, 2006
Posts: 1
I tested the value in tomcat 5.5 without a <body-content>, it defaulted to JSP and generate an error at request time.

Hope it helps
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: body-content default value question