Hi Mallika,
Let me tell you that the hand notes provided next to the question 5 on pg 487 is with reference to that particular question.I am not sure if my answer will help you resolve your confusion but this is what I have to say:
1)
If a tag includes scripting code , it must have at least JSP body content
This statement tells that if a tag has scripting code in its body then it should have body-content set as JSP the reason is that other three body-content type won't allow scripting code to be evaluated by the JSP translator.
Content-type 'empty' indicates tag should not use body, so this choice is eliminated, 'scriptless' indicates tag should not have scripting elements and 'tagdependent' means the tag body should not be translated by JSP translator therefore any text in the body should be treated as template data.
2)
Again for another tag it says, if the tag contains no scripting it may have either JSP or scriptless body content
This statement was given with reference to <my:tag3> which has body containing an EL. Now since it is EL we could possibly think that this tag can take body content as anything allowed by JSP or anything in JSP except scripting elements. If there were scripting elements then the only choice left for body-content was JSP.
3)
what if a tag is "empty"??what can be its body content along wiht"empty" according to the question, it says an empty tag can have JSP or scriptless. why not tagdependent??
The handwritten statement say that "Tag2 is only shown as an empty tag, but it could also contain 'JSP' or 'scriptless' body-content". When we look at the choices there is no choice in the question which is showing 'tag2 body-content is tagdependent' this is the reason it was mentioned in this manner. However empty tag can have body-content as 'tagdependent' also. In any case body-content tagindependent will treat tag with any code inside its body as template text. I have tested this.
I hope it is clear to you now. I tried to explain from whatever I have understood uptill now.
Thanks,
-Rancy