• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

body-content default value question

 
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in HFSJ , it has been mentioned that body-content tag on the TLD is mandatory.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 290
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic