| Author |
body-content element combinations in the TLD
|
Shobhan Ganta
Ranch Hand
Joined: Nov 11, 2010
Posts: 37
|
|
Hi,
This is from HFSJ - 2 mock exam ch.9 Q.5.
Which <body-content> element combinations in the TLD
are valid for the following JSP snippet? (Choose all that apply.)
11. <my:tag1>
12. <my:tag2 a=”47” />
13. <% a = 420; %>
14. <my:tag3>
15. value = ${a}
16. </my:tag3>
17. </my:tag1>
A. tag1 body-content is empty
tag2 body-content is JSP
tag3 body-content is scriptless
B. tag1 body-content is JSP
tag2 body-content is empty
tag3 body-content is scriptless
C. tag1 body-content is JSP
tag2 body-content is JSP
tag3 body-content is JSP
D. tag1 body-content is scriptless
tag2 body-content is JSP
tag3 body-content is JSP
E. tag1 body-content is JSP
tag2 body-content is scriptless
tag3 body-content is scriptless
The correct answers given are B,C,E.
But for me this looks to be tricky as I have choosen only option B.
Any explanation would be helpful.
Thanks
Shobhan
|
 |
Frits Walraven
Rancher
Joined: Apr 07, 2010
Posts: 1039
|
|
Hi Shobhan ,
C is correct because body-content is JSP effectively means: all jsp fragments are allowed (EL, scriptlets, HTML, template text). It also means that an empty body is allowed (tag2)
E is correct because body-content scriptless means: no scriptlets, but EL and template text is allowed
Regards,
Frits
|
 |
Shobhan Ganta
Ranch Hand
Joined: Nov 11, 2010
Posts: 37
|
|
|
Thanks Frits.
|
 |
 |
|
|
subject: body-content element combinations in the TLD
|
|
|