• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tag file problem

 
Chaminda Amarasinghe
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we declare a Tag that must not have a body in a Tag file

I think correct one is

<@tag body-content="empty" %>

but HFSJ says in page no 548

<@tag body-content="tagdependant" %>

what is the correct?
 
Amirr Rafique
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<@tag body-content="empty" %>

means the tag cannot have body.
<@tag body-content="tagdependant" %>

tells that the tag can have body but its body will be taken as text. If the tag body contains any EL or scriptlet it won't be evaluated and will be printed as it is
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then what does saying body-content = "scriptless" means?? I think this resembles more closely to saying tagdependent??? Am I right?
 
Harshit Patel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scriptless means that it should not have any scripting elements, else translation error will be thrown
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That means with tagdependent, we can have EL, scripting elements, but they won't be evaluated and they will just be printed like the body. Am I right guys??
 
Chaminda Amarasinghe
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all.
 
Amirr Rafique
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jothi Shankar Kumar Sankararaj:
Then what does saying body-content = "scriptless" means?? I think this resembles more closely to saying tagdependent??? Am I right?


The body-content = "scriptless" means the body cannot have scriptlets (scriptless <%..%>, expression <%= .. %> and declaration <%! .. %>) but it can have EL and <jsp:...>.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic