• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

body-content element combinations in the TLD

 
Shobhan Ganta
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2532
112
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frits.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic