• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

body-content default value question

 
Frederic Esnault
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Chandra Sagi
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in HFSJ , it has been mentioned that body-content tag on the TLD is mandatory.
 
parra matta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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) ??
 
Steven Colley
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ??
 
Steven Colley
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic