Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

body-content in tag

 
Sim Kim
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is <body-content> in <tag> element optional in a tag library descriptor ?
 
Dale Seng
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The body-content element provides provides information on the content of the
body of this tag. This element is primarily intended for use by page composition
tools.
There are currently three values specified:
tagdependent The body of the tag is interpreted by the tag implementation itself,
and is most likely in a different ´┐Żlangage´┐Ż, e.g embedded SQL statements.
JSP The body of the tag contains nested JSP syntax
empty The body must be empty
This element is optional; the default value is JSP
 
Sim Kim
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JSP 2.0 spec it says : Body content is mandatory .
Even HF Servlets and JSP page : Page 498 says so ...

Please clarify ?
 
Sim Kim
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help guys ....

What is the default <body-content> for custom tags and simple tags OR is it mandatory to have body content ......

Also what does <body-content>tagdependant<body-content> signify ?

This is in context of JSP 2.0 not JSP 1.2
 
Francois Roland
Ranch Hand
Posts: 34
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For JSP 1.2, here is an excerpt from the web-jsptaglibrary_1_2.dtd:

This means that body-content attribute is optional.

For JSP 2.0, here is an excerpt from the web-jsptaglibrary_2_0.xsd:

As you can see, and as it is stated in the documentation, the body-content is now mandatory, and the four acceptable values are: tagdependent, JSP, empty, scriptless.

I hope this answer will help you.
 
Sharma Anjali
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HF says default value for body-content is scriptless.
If body-content is mandatory then whats the relevance for a default value as you'll have to type in a value yourself ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic