Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

body-content default value works.. need clarification

 
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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic