1Z0-899 | Up to the minute 1Z0-899 Exam Study Guides With New Update Exam Questions


Q21. Which JSTL code snippet can be used to import content from another web resource? 

A. <c:import url = “foo.jsp”/> 

B. <c:import page = “foo.jsp”/> 

C. <c:include url = “foo.jsp”/> 

D. <c:include page = “foo.jsp”/> 

E. Importing cannot be done in JSTL. A standard action must be used instead. 

Answer: A

Q22. Given an HttpServletRequest request: 

22. 

String id = request.getParameter(“jsessionid”); 

Q23. Given an EL function declared with: 

Which two are true? (Choose two) 

A. The function method must have the signature: public String spin(). 

B. The method must be mapped to the logical name “spin” in the web.xml file. 

C. The function method must have the signature: public String spinIt(). 

D. The function method must have the signature: public static String spin(). 

E. The function method must have the signature: public static String spinIt(). 

F. The function class must be named Spinner, and must be in the package com.example. 

Answer: EF 

Q24. Given: 

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.b)} 

Answer: ACE

Q25. The Squeaky Beans Inc. shopping application was initially developed for a non-distributed environment. The company recently purchased the Acme Application Server, which supports distributed Httpsession objects. When deploying the application to the server, the doployer marks it as distributable in the web application deployment descriptor to take advantage of this feature. 

Given this scenario, which two must be true? (Choose two) 

A. The J2EE web container must support migration of objects that implement serializable. 

B. The J2EE web container must use the native JVM Serialization mechanism for distributing HttpSesaion objects. 

C. As per the specification, the J2EE web container ensures that distributed Httpsassion objects will be stored in a database. 

D. Storing references to Enterprise JavaBeans components in the HttpSession object might NOT supported by J2EE web contain. 

Answer: AD

Q26.

 object value = session.getAttribute(key); 

Q27.  

Which is true? 

A. Only a single instance of Myobject may exist within a session 

B. The unbound method of the Myobject instance is called when the session to which it is bound times out 

C. The com.example.MyObject must be declared as a servlet event listener in the web application deployment descriptor 

D. The valueUnbound method of the Myobject instance is called when the session to which it is bound times out 

Answer:

Q28. Refer to the Exhibit. 

A servlet sets a session-scoped attribute product with an instance of com.example.product an forward to a JSP. 

Which two output the name of the product in the response? (Choose two) 

A. <%= product.getName() %> 

B. <jsp:useBean id="product" class="com.example.Product" /> 

<%= product.getName() %> 

C. <jsp:useBean id="com.example.Product" scope="page"> 

<%= product.getName() %> 

</jsp:useBean> 

D. <jsp:useBean id="product" type="com.example.Product" 

scope="page" /> 

<%= product.getName() %> 

E. <jsp:useBean id="product" type="com.example.Product"> 

<%= product.getName() %> </jsp:useBean> 

Answer: BD

Q29. Which of following annotations can be used in a servlet class? 

-@javax.annotation.Resource -@javax.annotation.PreDestroy -@javax.annotation.security.RunAs -@javax.annotation.security.RolesAllowed -@javax.servlet.annotation.WebServlet 

A. (v) only 

B. (i) and (v) 

C. (i), (ii), (iii) and (v) 

D. (i), (ii), (iv) and (v) 

E. (i), (ii), (iii), (iv) and (v) 

Answer:

Q30.  

Assume session is an HttpSession, and is not referenced anywhere else in ServletA. 

Which two changes, taken together, ensure that value is equal to “Hello” on line 23? (Choose two) A. ensure that the ServletB.service method is synchronized 

B. ensure that the ServletA.service method is synchronized 

C. ensure that ServletB synchronizes on the session object when setting session attributes 

D. enclose lines 21-22 in synchronized block: 

synchronized(this) ( 

session.setAttribute(key, “Hello”); 

value = session.getAttribute(key); 

E. enclose lines 21-22 in synchronized block: 

synchronized(session) ( 

session.setAttribute(key, “Hello”); 

value = session.getAttribute(key); 

Answer: CE