This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

body-content to be JSP

 
Isha Garg
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a doubt regarding body-content.

According to HF Page-482, The possible values for body-content are empty/tagdependent/scriptless/JSP.

If i make body-content to be JSP in my .tld file, then my understanding says that I can have scriptlet in the body of my tag.
But When I make body-content to be JSP in my tld file, then I ger following exception

JasperException: The TLD for the class foo.AdviceTagHandler specifies an invalid body-content (JSP) for a SimpleTag.#

It does not even identify JSP body content.
My AdviceTagHandler extends SimpleTagSupport.

Can you please tell me how can I have scriptlets in the body of my tag.
 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isha Garg wrote:
According to HF Page-482, The possible values for body-content are empty/tagdependent/scriptless/JSP.

Hi Isha,

Actually if you read the page carefully, here is what it says:

"The <body-content> element can be one of either three or four values, depending on the type of tag."

I believe the following allow JSP body-content:
- Custom tag handlers that extend Classic tag classes (TagSupport & BodyTagSupport)
- JSTL


The following support body-content to be empty/ tagdependent/ scriptless but NOT JSP
- Custom tag handlers that extend Simple tag class (SimpleTagSupport)
- Tag files
 
Isha Garg
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Nidhi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic