• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

body-content default values, confusion ....

 
Narasimha Rao B.
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am bit confused with the default values for body-content tag, here is my understanding, can some clarify Whether it is correct or not? If it is wrong what the correct explanation?
For Tag files :->
(1) Possible values are - tagdependent, empty and scriptless
(2) Default value is scriptless
(3) It is an optional field.

For Simple and classic tag handlers :->
(1) As per JSP 2.0, it is not an optional, it is mandatory to have body-content tag.
(2) Valid values are - tagdependent, empty, scriptless and JSP
(3) If the value is JSP and the body has scriptlets or scriptlet expression, it will give an error.(hence JSP is not really a meangifull option)
Please correct me if i am wrong, soon i am going for the exam and it is very critical...

Thanks in Advance,
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Most of your points are valid. except,
1. if you have body-content as JSP, you can have scriptlets inside that..Whatever that goes into JSP, you can have. you dont get any error.
2. For simple tags(which extend SimpleTag) cannot have JSP as body-content. Only classic tags can have body-content.
 
Narasimha Rao B.
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rizwan for your reply,

Do you mean to say that,
(1) For Simple tags, you can't have 'JSP' as body content, so you can't have any jsp code as body content.
(2) For classic tags, you can have 'JSP' as body content, and if the <bod-content> is 'JSP', you can have any valid jsp code in the body.
Is it correct?

Thanks,
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you are 100% correct. for simple tags we cannot have JSP as body content and for classic tags you can have JSP as body-content and you can give any scriptlet inside the tag for classic tag. All the best for your exam Narasimha.
 
AmitKumar Jain
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per SCWCD Book by Manning,

For Classic tags : JSP(default), tagdependent , empty

For Simple tags: scriptless(default) , tagdependent , empty

For Tag Files : scriptless(default) , tagdependent , empty

Can Anyone tell me whether we can use scriptless in classic tags??
HFSJ does not say anything about this....

And the mere fact that the default values are specified, shows that the body-content element is optional in all three cases.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic