1Z0-899 | All About Top Quality 1Z0-899 braindumps


Q51. Which annotation specifies the metadata as a javax.servlet.http.HttpSessionListener? 

A. @Listener 

B. @WebListener 

C. @WebSessionListener 

D. @HttpSessionListener 

Answer:

Q52.  

// do stuff 

Q53. Given the JavaBean class: 

public class MyBean { 

private Boolean roasted = false; 

public MyBean () {} 

public Boolean isRoasted () { returned roasted } 

public void setRoasted (Boolean roasted) { this.roasted = roasted; ] 

Assume a controller has created an instance of this bean, called setRoasted (true), and inserted the bean into the application scope using the name “myBean”. 

A JSP contains these two tags: <jsp: useBean id = “aBean” class = “MyBean” scope = “page” /> 

<jsp: getProprty name = “aBean” property = “roasted” /> 

Which is true? 

A. the page will include the output false 

B. the page will include the output 

C. the page will report that the property roasted does not exist 

D. the page will report that the syntax of the useBean tag is incorrect 

E. the page will report that the syntax of the getProperty tag ls incorrect 

Answer:

Q54. During initialization, a servlet finds that the database connection it requires is unavailable. As the system designer, you know that the database start up completes several minutes after the web-container initializes the servlet. How should this be handled? 

A. Retry the connection until it is successful, then allow the init () method to complete. 

B. Throw a ServletException 

C. Throw the IOException 

D. Throw an UnavailableException 

Answer:

Q55.  

<error-page> 

Q56.

 session.setAttribute(key, “Hello”); 

Q57. Which method must be used to encode a URL passed as an argument to HttpServletResponse. 

sendRedirect when using URL rewriting for session tracking? 

A. ServletResponse.encodeURL 

B. HttpServletResponse.encodeURL 

C. ServletResponse.encodeRedirectURL 

D. HttpServletResponse.encodeRedirectURL 

Answer:

Q58. A web application for business expense reporting allows uploading expense receipts. Multiple receipts can be uploaded single step using one HTTP request. The servlet that processes the request has been marked with the @MultipartConfig annotation. 

Which method should the servlet use to access the uploaded files? 

A. HttpServletRequest.getParts() 

B. HttpServletRequest.getData() 

C. servletRequest.getParts() 

D. servletRequest.getAllParts() 

Answer:

Q59. When using Servlet asynchronous API if you want to dispatch the request back to a particular url -"/url" within the same Servlet Context which of the following API would you use? 

A. ASyncContext.dispatch(); 

B. AsyncContext.dispatch("/url"); 

C. AsyncContext.dispatch(servletContext, "/url"); 

D. AsyncContext.start(runnable); 

E. RequestDispatcher.fotward("/url"); 

F. RequestDispatcher.forward(servletContext, "/url"); 

G. RequestDispatcher.include("/url"); 

Answer: AC 

Q60. You are building a dating service web site. Part of the form to submit a client's profile is a group of radio buttons for the person's hobbies: 

20. <input type = ‘radio’ name = ‘hobbyEnum’ value = ‘HIKING’> Hiking <br> 

21. <input type = ‘radio’ name = ‘hobbyEnum’ value = ‘SKING’> Sking <br> 

22. <input type = ‘radio’ name = ‘hobbyEnum’ value = ‘SCUBA’> SCUBA <br> 

23. <! - - and more options - - >> 

After the user submits this form, a confirmation screen is displayed with these hobbies listed. Assume that an application-scoped hobbies, holds a map between the hobby enumerated type and the display name. 

Which EL code snippet will display Nth element of the user's selected hobbles? 

A. ${hobbies [hobbyEnum[N]} 

B. ${hobbies [paramValues.hobbyEnum[N]]} 

C. ${hobbies [paramValues @ ‘hobbyEnum’ @N] 

D. ${hobbies.get(paramValues.hobbyEnum[N]) } 

E. ${hobbies [paramValues.hobbyEnum.get(N)] } 

Answer: B