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

body-content default value works.. need clarification

 
Anoopriya Muthuswaami
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There were many thread in this forum related to default value of body-content.

I tried few examples and have following question

If spec says <body-content> is mandatory, how am I be able to run custom tag without <body-content> in TLD

CASE 1:
Custom tag extends SimpleTagSupport
no <body-content> mentioned in TLD

Result:
HTTP status 500
The TLD for the class example.TextTag specifies an invalid body-content (JSP) for a SimpleTag.

This means by default it takes JSP as default value for body-content. Since SimpleTags cannot have scriptless, it says "JSP" is not a valid body-content.

CASE2:
Custom tag extends TagSupport
no <body-content> mentioned in TLD
JSP had expression within body of tag

Result:
Expression in body of tag got evaluated.

When expression got evaluated, it means <body-content> is JSP

Please clarify me on this.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This means by default it takes JSP as default value for body-content.

No, I think it depends on the container you are using. There is no default value for Simple Tags, so you have to set one explicitly. If you don't, results may vary depending on the container being used. Check this FAQ.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic