aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes using JSTL query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "using JSTL query" Watch "using JSTL query" New topic
Author

using JSTL query

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Head First servlets and JSP

chapter9 Using JSTL


5.Which <body-content> element combinations in the TLD
are valid for the following JSP snippet? (Choose all that apply.)



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


correct-B,C,E

Tag1 includes scripting code so it must have at
least 'JSP' body-content. Tag2 is only shown
as an empty tag, but it could also contain 'JSP'
or 'scriptless' body-content. Tag3 contains no
scripting code so it may either JSP or scriptless body-content

In the answer its mentioned that Tag3 can have JSP or scriptless as body content

IF JSP is the body content,then it can have scriplets,declarations.
IF scritpless is body content ,then it can have no scripltes,declarations.

i find theses two statements as contradictory.so,
How can Tag3 have JSP or scriptless as body content ?



OCPJP 6.0 93%
OCPJWCD 5.0 98%
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1672
    
  25

i find theses two statements as contradictory.so,
How can Tag3 have JSP or scriptless as body content ?

It is all about language: in this example Tag3 has no scripting code so scriptless is allowed. It has a body, so empty is not allowed. This leaves JSP as an option: it could be JSP as well because the body you are seeing qualifies for JSP (where pretty much everything is allowed including scriptlets).

Keep in mind that JSP doesn't mean that you have to use scriptlets.

Regards,
Frits
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using JSTL query