• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in body-content value

 
Vinoth Selvaraj
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is JSP a valid value for <body-content> sub-element of tag element in
tag library descriptor.

I have read somewhere that if you want to make your tag accept JSP as the value for the <body-content>, then you should not make an entry for the <body-content> sub-element under tag element. And the tag handler assumes it as JSP.

Even i have tried to use JSP as the value for the <body-content>, but the
container is showing me an error 'it is not a valid value'. But in HFSJ, no
information about this problem.

Please give me some info about this, if you know?

With Regards
Vinoth Selvaraj
 
Kiaama Liames
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<body-content> in custom tags can have one of the three values

empty: Specifies that the body of the tag must be empty

JSP: Specifies that the body of the tag can accept any normal JSP code

tagdependent : Specifies that the content is not to be interpreted by the JSP engine and is tag dependent

The default is JSP

SimpleTag's body must not contain scripts-no declarations,expressions, or scripts.So it is invalid for a SimpleTag's tag library descriptor to specify its <body-content> as JSP.
 
Vinoth Selvaraj
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what about the value scriptless?
 
Kiaama Liames
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<body-content> in simple tags can have one of the three values:

empty: Specifies that the body of the tag must be empty

tagdependent : Specifies that the content is not to be interpreted by the JSP engine and is tag dependent

scriptless: SimpleTags cannot process script elements (declarations,expressions,scripts) inside body content hence scriptless , however it can contain template text,EL expression, and JSP action elements

If you want to process a SimpleTag's body , you need to set its <body-content> to tagdependent or scriptless . The specification does not define a default value for a simple tag handlers it depends on the implementation
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic