1Z0-899 | how many questions of 1Z0-899 dumps?


Q61. Given that a web application consists of two HttpServlet classes, ServletA and ServletB, and the ServerletA.service method: 

20.

 String key = “com.example.data”; 

Q62. The jquery_1_3_2.jar file contains the JQuery Ajax framework in its META-INF/ resources directory. Where should the jar file be placed inside the web application to ensure the resources it contains are accessible by clients? 

A. WEB-INF/classes 

B. WEB-INF/jar 

C. WEB-INF/lib 

D. WEB INF/resources 

Answer:

Q63. As a convenience feature, your web pages include an Ajax request every five minutes to a special servlet that monitors the age of the user’s session. The client-side JavaScript that handles the Ajax callback displays a message on the screen as the session ages. The Ajax call does NOT pass any cookies, but it passes the session ID in a request parameter called sessionID. In addition, assume that your webapp keeps a hasmap of session objects by the ID. Here is a partial implementation of this servlet: 

10.

 public class SessionAgeServlet extends HttpServlet { 

Q64.  

<role-link>Administrator</role-link> 

Q65. Given: 

11. <% 

12. request.setAttribute (“vals”, new String[] {“1”, “2”, “3”, “4”}); 

13. request.setAttribute (“index”, “2”); 

14. %> 

15. <% - - insert code here - - %> 

Which three EL expressions, inserted at line 15, are valid and evaluate to “3”? (Choose three) 

A. ${vals.2} 

B. ${vals [“2”] } 

C. ${vals.index} 

D. ${vals[index] } 

E. ${vals} [index] 

F. ${vals. (vals.index) } 

G. ${vals [vals[index-1]] } 

Answer: BDG

Q66. Which EL expression returns true if no session has been established with current client? 

A. ${not(pageContext.session)} 

B. ${not(requestScope.session)} 

C. ${requestScope.sessions.this} 

D. ${sessionScope.empty} 

Answer:

Q67.  

</security-role-ref> 

Q68. When using the @WebListener annotation, the class on which the annotation is applied to must also implement at least one o the following interfaces – (Choose two): 

A. RequestListener 

B. AttributeListener 

C. ServletContextListener 

D. HttpSessionListener 

E. SessionAttributeListener 

F. AsyncListener 

Answer: CD

Q69. Click the Exhibit button. 

Given the HTML form: 

1. <html> 

2. <body> 

3. <form action="submit.jsp"> 

4. Name: <input type="text" name="i1"><br> 

5. Price: <input type="text" name="i2"><br> 

6. <input type="submit"> 

7. </form> 

8. </body> 

9. </html> 

Assume the product attribute does NOT yet exist in any scope. 

Which code snippet, in submit.jsp, instantiates an instance of com.example.Product that contains the results of the form submission? 

A. <jsp:useBean id="com.example.Product" /> 

<jsp:setProperty name="product" property="*" /> 

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

${product.name = param.i1} 

${product.price = param.i2} 

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

<jsp:setProperty name="product" property="name" 

param="i1" /> 

<jsp:setProperty name="product" property="price" 

param="i2" /> 

</jsp:useBean> 

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

<jsp:setProperty name="product" property="name" 

value="<%= request.getParameter( "i1" ) %>" /> 

<jsp:setProperty name="product" property="price" 

value="<%= request.getParameter( "i2" ) %>" /> 

</jsp:useBean> 

Answer: C

Q70. A developer chooses to avoid using singieThreadModel but wants to ensure that data If; updated in a thread safe manner. 

Which two can support this design goal? (Choose two) 

A. Store the data in a local variable. 

B. Store the data in an instance variable. 

C. Store the data in the Httpsession object. 

D. Store the data in the sarvletContext object. 

E. Store the data in the ServletRequest object. 

Answer: AE