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

Scriplet and custom tags

 
amarkirt saroay
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the default body content for custom ttags?
Can I write scriplets in the tag in whic i dont specify whether its body content is "scriptless" or empty or tagdependent or JSP?
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Amarkirt. If we don't specify <body-content> the default is empty. We can write custom tags by 1) By extending SimpleTagSupport or implementing SimpleTag interface. 2)By extending TagSupport or by implementing IterationTag or by implementing Tag interface. 3)By extending BodyTagSupport or by implementing BodyTag. Most of the time, we simply extend the classes.

For SimpleTag handlers, the body cann't contain scriptlets(<% ... %>,<%= ...%>,<%! ... %>) eventhough if we specify <body-content>scriptless</body-content>. For ClassicTag handler's we can have scriptlets.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic