• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about custom tag

 
David Hu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,I have a question for Tag File:
From HFJ books P498,I knew for a cutom tag,the <body-content>element is default is scriptless.But when I did one mock exam, get the answer
is:The <body-content>empty|JSP|tagdependent</body-content> subelement of <tag> element defines what kind of body should this tag have. If it is not present, then "JSP" is assumed, implying, any valid jsp code is valid as a body of this tag.
If the tag provider wants to make sure that the body of tag should remain empty in the jsp file, then the <body-content> element of <tag> element should have a value of "empty". E.g.

<tag>
<name>Hello</name>
<tag-class>com.abc.HelloTag</tag-class>
<body-content>empty</body-content>
</tag>

This makes sure that the tag is NOT accidently passed a body ie.:
<mytaglib:Hello>anything here, even a space, is invalid</mytaglib:Hello>
Is it means <body-content> definition in *.tld file and tag file is different?
TKS for answer ASAP!
David
 
David Hu
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,I just checked spec,I found whatever in tld file or tag file, there isn't "JSP" param for <body-content>,just use none/empty/scriptless.Is it right?Pls help me.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic