Precise of 1Z0-899 practice materials and lab for Oracle certification for examinee, Real Success Guaranteed with Updated 1Z0-899 pdf dumps vce Materials. 100% PASS Java EE 6 Web Component Developer Certified Expert Exam exam Today!

2021 Sep 1Z0-899 exam cost

Q81. You are building a web application with a scheduling component. On the JSP, you need to show the current date, the date of the previous week, and the date of the next week. 

To help you present this information, you have created the following EL functions in the ‘d’ namespace: 

-Name : curData; signature: java.util.utilDate CurrentDate() 

-Name : curData; signature: java.util.utilDate addweek (java.util.Date, int) 

-Name: dateString; signature: java.util.String getDataString (jave.util.Data) 

Which EL code snippet will generate the string for the previous week? 

A. ${d:dateString(affWeek(curDate(), -1)) } 

B. ${d:dateString [addWeek[curDate[], - ]] } 

C. ${d:dateString [d:addWeek[d:curDate[], - 1]] } 

D. ${d:dateString (d:addWeek(d:curDate(), -1)) } 

Answer: D


Q82.  

<role-name>Admin</role-name> 


Q83. Assume a JavaBean com.example.GradedTestBean exists and has two attributes. The attribute name of type java.lang.string and the attribute score is of type jave.lang.Integer. An array of com.example.GradedTestBean objects is exposed to the page in a request-scoped attribute called results. Additionally, an empty java.util.HashMap called resultMap is placed in the page scope. A JSP page needs to add the first entry in results to resultMap, storing the name attribute of the bean as the key and the score attribute of the bean as the value. 

Which code snippet of JSTL code satisfies this requirement? 

A. ${resultMap[results[0].name]= results[0].score} 

B. <c:set var=“${resultMap}” key=“{results[0].name}” 

value=“${results[0].score}” /> 


C. <c:set var=“resultMap”property=“${results[0].name}”> 

${results[0].value} 

</c:set> 


D. <c:set var=“resultMap” property=“${results[0].name}”> 

value=“${results[0].score}” /> 


E. <c:settarget=“${resultMap}” property=“${results[0].name}”> 

value=“${results[0].score}” /> 


Answer: E 


Q84. Your web application requires the adding and deleting of many session attributes during a complex use case. A bug report has come in that indicates that an important session attribute is being deleted too soon and a NullPointerException is being thrown several interactions after the fact. You have decided to create a session event listener that will log when attributes are being deleted so you can track down when the attribute is erroneously being deleted. 

Which listener class will accomplish this debugging goal? 

A. Create an HttpSessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getName method on the event object. 

B. Create an HttpSessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getName method on the event object. 

C. Create an SessionAttributeListener class and implement the attributeRemoved method and log the attribute name using the getAttributeName method on the event object. 

D. Create an SessionAttributeListener class and implement the attributeDeleted method and log the attribute name using the getAttributeName method on the event object. 

Answer: B 


Q85. You have a use in your web application that adds several session-scoped attributes. At the end of the use case, one of these objects, the manage attribute, is removed and then it needs to decide which of the other session-scoped attributes to remove. 

How can this goal be accomplished? 

A. The object of the manager attribute should implement the HttpSessionBindingListener and it should call the removeAttribute method on the appropriate session attributes. 

B. The object of the manager attribute should implement the HttpSessionListenar and it should call the removeAttribute method on the appropriate session attributes. 

C. The object of the manager attribute should implement the HttpSessionBindingListener rind it should call the deleteAttribute method on the appropriate session attributes. 

D. The object of the manager attribute should implement the HttpsessionListener and it should call the deleteAttribute method on the appropriate session attributes. 

Answer: A


certifyforall.com

Most recent 1Z0-899 practice test:

Q86. Servlet A forwarded a request to servlet B using the forward method of RequestDispatcher. What attribute in B’s request object contains the URI of the original request received by servlet A? 

A. REQUEST_URI 

B. javax.servlet.forward.request_uri 

C. javax.servlet.forward.REQUEST_URI 

D. javax.servlet.request_dispatcher.request_uri 

E. javax.servlet.request_dispatcher.REQUEST_URI 

Answer: B 


Q87.  

</error-page> 



If the web application associated with the fragment above throws a ClassCastException. 

Which statement is true? 

A. The deployment descriptor is invalid. 

B. The container invokes mainError.jsp 

C. The container invokes castError.jsp 

D. Neither mainError.jsp nor castError.jsp is invoked. 

Answer: C 


Q88. A web application wants to expose to its clients an operation that results in a transaction being performed across several systems, for example the transfer of money from one bank account to another 

Which HTTP method should it use? 

A. GET 

B. HEAD 

C. OPT IONS 

D. POST 

Answer: D 


Q89. To add a servlet to a context that has not been declared either via annotation or via the descriptor, during context initialization time the following API can be used (Choose three.) 

A. servletContext.addServlet(“myServletName”, “MyServlet”); 

B. servletContext.addServlet( (<Class extends Servlet>)getClass().getClassLoader().getClassLoader().loaderClass(“MyServlet”)); 

C. servletContext.addServlet(myServlet); 

D. servletContext.addServlet( (“myServletName”, <Class extends Servlet>)gerClass().getClassLoader().loaderClass(“myServlet”)); 

E. servletContext.addServlet(“myServletName”, MyServlet); 


Answer: ADE 


Q90. 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: B