Meaningless Drivel is fun!*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Can anyone clear my questions? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Can anyone clear my questions? " Watch "Can anyone clear my questions? " New topic
Author

Can anyone clear my questions?

Mohandoss Ilangovan
Greenhorn

Joined: Jul 17, 2005
Posts: 6
Hi,

I am trying to get 100% correct answers for this questions. If you can give me please help me.

Which three occur during JSP page translation? (Choose three.)
The jspInit method is called.
The JSP page implementation class is created.
The JSP page implementation class is compiled.
The JSP page is validated for syntatic correctness.
The associated tag files are validated for syntatic correctness.
Answer:

Given the web application deployment descriptor:
10. <jsp-config>
11. <jsp-property-group>
12. <url-pattern>*.jsp</url-pattern>
13. <scripting-invalid>false</scripting-invalid>
14. </jsp-property-group>
15. </jsp-config>
and example.jsp:
10 x 5 = ${10 * 5}<br>
2 * 3 = <%= 2 * 3 %><br>
What is the result?
An error occurs during page translation.
Translation is successful, but nothing is included in the response.
Both "10 x 5 = 50" and "2 * 3 = 6" are included in the JSP response.
The text "10 x 5 = 50" is included in the JSP response, but "2 * 3 = 6" is NOT.
The text "2 * 3 = 6" is included in the JSP response, but "10 x 5 = 50" is NOT.

Which EL expression evaluates to the request URI?
${requestURI}
${request.URI}
${request.getURI}
${request.requestURI}
${requestScope.requestURI}
${pageContext.request.requestURI}
${requestScope.request.request.URI}

Given:
<% int[] nums = {42, 420, 4200};
request.setAttribute("foo", nums); %>
${5 + 3 lt 6}
${requestScope['foo'][0] ne 10 div 0}
${10 div 0}
What is the result?
true true
false true
false true 0
true true Infinity
false true Infinity
An exception is thrown.
Compilation or translation fails

Given an EL function foo, in namespace func, that requires a long as a parameter
and returns a Map, which two are valid invocations of function foo? (Choose two.)
${func(1)}
${foo:func(4)}
${func:foo(2)}
${foo(5):func}
${func:foo("easy")}
${func:foo("3").name}


A web application allows the HTML title banner to be set using a servlet context
initialization parameter called titleStr.
Which two properly set the title in this scenario? (Choose two.)
A. <title>${titleStr}</title>
B. <title>${initParam.titleStr}</title>
C. <title>${params[0].titleStr}</title>
D. <title>${paramValues.titleStr}</title>
E. <title>${initParam['titleStr']}</title>
F. <title>${servletParams.titleStr}</title>
G. <title>${request.get("titleStr")}</title>


11. <% java.util.Map map = new java.util.HashMap();
12. request.setAttribute("map", map);
13. map.put("a", "b");
14. map.put ("b", "c");
15. map.put("c", "d"); %>
16. <%-- insert code here -- %>
Which three EL expressions, inserted at line 16, are valid and evaluate to "d"?
(Choose three.)
A. ${map.c}
B. ${map[c]}
C. ${map["c"]}
D. ${map.map.b}
E. ${map[map.b]}
F. ${map.map(map.b)}

Which three are described in the standard web application deployment descriptor?
(Choose three.)
A. session configuration
B. MIME type mappings
C. context root for the application
D. servlet instance pool configuration
E. web container default port bindings
F. ServletContext initialization parameters

A CertKing .com developer chooses to avoid using SingleThreadModel but wants to
ensure that data is updated in a thread-safe manner.
Which two can support this design goal? (Choose two.)
A. Store the data in a vocal variable.
B. Store the data in an instance variable.
C. Store the data in the HttpSession object.
D. Store the data in the ServletContext object.
E. Store the data in the ServletRequest object.
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
Hi,

What are your answers ?

Thanks


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
my answers:


Which three occur during JSP page translation? (Choose three.)
The JSP page implementation class is created.
The JSP page implementation class is compiled.
The JSP page is validated for syntatic correctness.



Given the web application deployment descriptor:
10. <jsp-config>
11. <jsp-property-group>
12. <url-pattern>*.jsp</url-pattern>
13. <scripting-invalid>false</scripting-invalid>
14. </jsp-property-group>
15. </jsp-config>
and example.jsp:
10 x 5 = ${10 * 5}<br>
2 * 3 = <%= 2 * 3 %><br>
What is the result?

Both "10 x 5 = 50" and "2 * 3 = 6" are included in the JSP response.

note that scripting-invalid is set to false not true


Which EL expression evaluates to the request URI?
${pageContext.request.requestURI}



Given:
<% int[] nums = {42, 420, 4200};
request.setAttribute("foo", nums); %>
${5 + 3 lt 6}
${requestScope['foo'][0] ne 10 div 0}
${10 div 0}
What is the result?
false true Infinity



Given an EL function foo, in namespace func, that requires a long as a parameter
and returns a Map, which two are valid invocations of function foo? (Choose two.)
${func:foo(2)}
${func:foo("3").name}



A web application allows the HTML title banner to be set using a servlet context
initialization parameter called titleStr.
Which two properly set the title in this scenario? (Choose two.)
B. <title>${initParam.titleStr}</title>
E. <title>${initParam['titleStr']}</title>



11. <% java.util.Map map = new java.util.HashMap();
12. request.setAttribute("map", map);
13. map.put("a", "b");
14. map.put ("b", "c");
15. map.put("c", "d"); %>
16. <%-- insert code here -- %>
Which three EL expressions, inserted at line 16, are valid and evaluate to "d"?
(Choose three.)
A. ${map.c}
C. ${map["c"]}
E. ${map[map.b]}



Which three are described in the standard web application deployment descriptor?
(Choose three.)
A. session configuration
B. MIME type mappings
F. ServletContext initialization parameters



A CertKing .com developer chooses to avoid using SingleThreadModel but wants to ensure that data is updated in a thread-safe manner.
Which two can support this design goal? (Choose two.)
A. Store the data in a vocal variable.
E. Store the data in the ServletRequest object.



MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can anyone clear my questions?
 
Similar Threads
EL doubt
Doubt on a question in EL
Question regarding Expression Language
Cannot understand EL with Maps
Regarding Expression Language