• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in custom tags

 
akilan irudaya raja
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

What is the difference between setting body-content attributes tagdependent and scriptless. Both are seems to be similar.

Thanks
Akilan

SCJP,SCBCD
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"tagdependent" means that the container won't even attempt to parse the contents of the tag. All the content will be passed literally to the tag handler. This is useful when you're using a language in your tag body which will be interpreted totally by your own custom tag and never by the container (the spec. gives the example of SQL).

A body-content of "JSP" means that the container will evaluate all JSP scripting elements and EL expressions it encounters in the body of the tag, passing the tag handler the evaluated result.

"scriptless" means that the tag must not contain JSP scripting elements, but may still contain EL expressions. If the container encounters a JSP scripting expression, it raises a translation error. If it encounters an EL expression, it evaluates it.

Note that "scriptless" is quite different from "tagdependent" in that the container will actively parse the body of a scriptless tag while it will always completely ignore the body of a tagdependent action.
 
akilan irudaya raja
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Charles!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic