Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

custom tags doubt!

 
Shashank vanjare
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If simple Tags cannot have scriplets within their body, then what is the use of giving body content as JSP..
pls help me clarify this
 
Ravi Singh
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But when we give JSP inside body content that is
<body-content>JSP</body-content>

It means that you can use EL in it .

But if you use Scripting elements like expression it will be considered as
plain html text
 
Shashank vanjare
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you ravi..it would be helpfull if you can tell me the source where you got info on that..in HFSJ they havent mentioned anything on that!
 
John Pearson
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right that it wouldn't make sense to have a Simple tag with <body-content>JSP</body-content>. You'll get an error from most containers if you specify a body-content of JSP in your TLD.

The following is from the JSP 2.0 spec:
Because JSP fragments do not support scriptlets, the <body-content> of a SimpleTag cannot be �JSP�. A TLD is invalid if it specifies �JSP� as the value for <body-content> for a tag whose handler implements the SimpleTag interface. JSP containers are recommended to but not required to produce an error if �JSP� is specified in this case.
 
Shashank vanjare
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks John for your explanation....it clarified my doubt..
but what if the tag handler is Classic ..does it allow <body-content>to be JSP?
 
Javier Snaider
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, you can use this body content (JSP) for standard custom Tags not for simple custom tags. The tld file doesn't diference this, but if you use JSP body content and implement simple custom tag class, you get an error.
So this body content works only for old fashoned custom Tags

Javier Snaider
SCWCD 5
 
Shashank vanjare
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Javire for the information..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic