1Z0-899 | All About Approved 1Z0-899 pdf


Q71. Refer to the Exhibit. 

Assuming the tag library in the exhibit is imported with the prefix forum, which custom tag invocation procedures a transaction error in a jsp page? 

A. <forum:message from="My Name" subject="My Subject" /> 

B. <forum:message subject="My Subject"> 

My message body. 

</forum:message> 

C. <forum:message from="My Name" subject="${param.subject}"> 

${param.body} 

</forum:message> 

D. <forum:message from="My Name" subject="My Subject"> 

<%= request.getParameter( "body" ) %> 

</forum:message> 

E. <forum:message from="My Name" 

subject="<%= request.getParameter( "subject" ) %>"> 

My message body. 

</forum:message> 

Answer: D

Q72. Given: 

1. <% int[] nums = {42,420,4200}; 

2. request.setAttribute("foo", nums); %> 

3. ${5 + 3 It 6} 

4. S(requestScope['foo'][0] ne 10 div0> 

5. ${10 div 0} 

What is the result? 

A. true true 

B. false true 

C. false true 0 

D. true true Infinity 

E. false true Infinity 

F. An exception is thrown 

G. Compilation or translation fails 

Answer: E

Q73. 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:

Q74. You are creating a JSP page to display a collection of data. This data can be displayed in several different ways so the architect on your project decided to create a generic servlet that generates a comma delimited string so that various pages can render the data in different ways. This servlet takes on request parameter: objoctID. Assume that this servlet is mapped to the URL pattern: /WEB-INF/data. 

In the JSP you are creating, you need to split this string into its elements separated by commas and generate an HTML <ul> list from the data. 

Which JSTL code snippet will accomplish this goal? 

A. <c:import varReader='dataString' url='/WEB-INF/data'> 

<c:param name='objectID' value='${currentOID}' /> 

</c:import> 

<ul> 

<c:forTokens items'${dataString.split(",")}' var='item'> 

<li>${item}</li> 

</c:forTokens> 

</ul> 

B. <c:import varReader='dataString' url='/WEB-INF/data'> 

<c:param name='objectID' value='${currentOID}' /> 

</c:import> 

<ul> 

<c:forTokens items'${dataString}' delims=',' var='item'> 

<li>${item}</li> 

</c:forTokens> 

</ul> 

C. <c:import var='dataString' url='/WEB-INF/data'> 

<c:param name='objectID' value='${currentOID}' /> 

</c:import> 

<ul> 

<c:forTokens items'${dataString.split(",")}' var='item'> 

<li>${item}</li> 

</c:forTokens> 

</ul> 

D. <c:import var='dataString' url='/WEB-INF/data'> 

<c:param name='objectID' value='${currentOID}' /> 

</c:import> 

<ul> 

<c:forTokens items'${dataString}' delims=',' var='item'> 

<li>${item}</li> 

</c:forTokens> 

</ul> 

Answer: D

Q75. For which three events can web application event listeners be registered? (Choose three.) 

A. when a session is created 

B. after a servlet is destroyed 

C. when a session has timed out 

D. when a cookie has been created 

E. when a servlet has forwarded a request 

F. when a session attribute value is changed 

Answer: ACF 

Q76. You are creating a web form with this HTML: 

11. <form action="sendOrder.jsp"> 

12. <input type="text" name="creditCard"> 

13. <input type="text" name="expirationDate"> 

14. <input type="submit"> 

15. </form> 

Which HTTP method is used when sending this request from the browser? 

A. GET 

B. PUT 

C. POST 

D. SEND 

E. FORM 

Answer: A

Q77. Which JSP standard action can be used to import content from a resource called foo.jsp? 

A. <jsp:import file='foo.jsp' /> 

B. <jsp:import page='foo.jsp' /> 

C. <jsp:include page='foo.jsp' /> 

D. <jsp:include file='foo.jsp' /> 

E. <jsp:import>foo.jsp</jsp:import> 

F. <jsp:include>foo.jsp</jsp:include> 

Answer: C

Q78. APIs for dynamically registering servlets and filters can be called at: 

A. Context initialization time 

B. Any time 

C. There is no way to dynamically register servlets and filters 

D. Context destruction time 

E. Injected into a servlet context 

Answer: A

Q79. ServletContextListeners are invoked in 

A. Random order 

B. contextInitialized and contextDestroyed are invoked in the order in which they are declared in the web.xml 

C. contextInitialized method are invoked in the order in which they are declared in the web.xml and the contextDestroyed method is invoked in the reverse order in which they are declared in the web.xml 

D. contextInitialized and contextDestroyed are invoked in the reverse order of which they are declared in the web.xml 

Answer:

Q80. In which two locations can library dependencies be defined for a web application? (Choose two) A. the web application deployment descriptor 

B. the /META-INF/dependencies.xml file 

C. the /META-INF/MANIFEST.MF manifest file 

D. the /META-INF/MANIFEST.MF manifest of a JAR in the web application classpath 

Answer: CD