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

Scripting in body of Custom Tags

 
Puneet Vashisht
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guyz,

I'm very confused about this thing.

Simple tag cannot have scripting in their body, because JspFragment must not contain any scripting elements.
So the <body-content> tag in tld file, cannot have a value
<body-content>JSP</body-content>

Now my question is, are classic tags allowed to have scripting in their bodies, i mean can i write something like this :

<%! int i%>
<my:ClassicTag>
<%=i++;>
</my:ClassicTag>

If they are not, then what is <body-content>JSP</body-content> used for. I mean if it is not used with Simple Tag, Tag File, where is it used??

Please clearify....

thankz,

puneet
SCJP, SCBCD 1.3
 
sarang bharambe
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

classic tags can have scripting in it's body.
so this
<%! int i%>
<my:ClassicTag>
<%=i++;>
</my:ClassicTag>
is possible.
and you have to use <body-content>JSP</body-content> in the DD for the tag.

regards,
sarang
 
Puneet Vashisht
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thankx buddy, u very right
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic