aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes body-content element combinations in the TLD Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "body-content element combinations in the TLD" Watch "body-content element combinations in the TLD" New topic
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: body-content element combinations in the TLD
 
Similar Threads
Custom tags Qn in K &B pg 560
Doubt in HeadFirst question
lt body-content gt element in TLD
using JSTL query
Doubt on Qno-:5 Pno-:487(HFS&JSP)