• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

body-content default value works.. need clarification

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic