File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes body-content to be JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "body-content to be JSP" Watch "body-content to be JSP" New topic
Author

body-content to be JSP

Isha Garg
Greenhorn

Joined: Mar 12, 2010
Posts: 29
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

Joined: Oct 19, 2009
Posts: 252

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

"A problem well stated is a problem half solved.” - Charles F. Kettering
SCJP 6, OCPJWCD
Isha Garg
Greenhorn

Joined: Mar 12, 2010
Posts: 29
Thanks for your reply Nidhi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: body-content to be JSP