Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is "JSP" a valid value for body-content element

 
Eshu San
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

In a SimpleTagSupport class the getJspBody returns JspFragment object.JspFragment is an object that wraps the body of the tag that invoked it and sent to the setJspBody() method during the invocation of the tag.so when getJspBody is called ,JspFragment object which wraps the body of the tag is returned.
In the book HFS it's mentioned that JspFragment must not contain "SCRIPTING ELEMENTS".My doubt is that there is a value called "JSP" for the
body-content element in the tld.As we know JSP means it can have scripting also.Does this mean that "JSP" is not a valid value for the body-content element whose parent element <tag>'s implementation class should not extend SimpleTagSupport coz the concept of JspFragment is applicable only to SimpleTags and not classic tags.

can anyone pls explain me
 
Abhishek Mahanty
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eshu San:
Hi

In a SimpleTagSupport class the getJspBody returns JspFragment object.JspFragment is an object that wraps the body of the tag that invoked it and sent to the setJspBody() method during the invocation of the tag.so when getJspBody is called ,JspFragment object which wraps the body of the tag is returned.
In the book HFS it's mentioned that JspFragment must not contain "SCRIPTING ELEMENTS".My doubt is that there is a value called "JSP" for the
body-content element in the tld.As we know JSP means it can have scripting also.Does this mean that "JSP" is not a valid value for the body-content element whose parent element <tag>'s implementation class should not extend SimpleTagSupport coz the concept of JspFragment is applicable only to SimpleTags and not classic tags.

can anyone pls explain me


Hi,
In JSP 2.0, we can have 2 types of custom tags
1. Classic Tags (Tags implementing Tag, IterationTag or BodyTag interface directly or indirectly)
2. Simple Tags (Tags implementing SimpleTag interface or Tags based on Tag Files)

In former's case <body-content> can have the following values - empty|tagdependent|JSP|Scriptless

But

for the later, valid values can be - empty|tagdependent|scriptless
("JSP" is not allowed since the tag's body is used to create JspFragment object which as you mentioned cannot have scripting elements)

I hope it answers your question.

Abhi.
[ November 19, 2004: Message edited by: Abhishek Mahanty ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic