1Z0-899 | All About Certified 1Z0-899 exam question


Q81. In a jsp-centric shopping cart application cart application to move a client’s home address of Customer object into the shipping address of the order object. The address data is stored in a value object class called Address with properties for: street address, city, province, country, and postal code. 

Which two code snippets can be used to accomplish this goal? 

A. <c:set var='order' property='shipAddress' value='${client.homeAddress}' /> 

B. <c:set target='${order}' property='shipAddress' value='${client.homeAddress}' /> 

C. <jsp:setProperty name='${order}' property='shipAddress' value='${client.homeAddress}' /> 

D. <c:set var='order' property='shipAddress'> <jsp:getProperty name='client' property='homeAddress' /> </c:store> 

E. <c:set target='${order}' property='shipAddress'> <jsp:getProperty name='client' property='homeAddress' /> </c:set> 

F. <c:setProperty name='${order}' property='shipAddress'> <jsp:getProperty name='client' property='homeAddress' /> </c:setProperty> 

Answer: BE

Q82. Which is a benefit of precompiling a JSP page? 

A. It avoids initialization on the first request. 

B. It provides the ability to debug runtime errors in the application. 

C. It provides better performance on the first request for the JSP page. 

D. It avoids execution of the _jspService method on the first request. 

Answer:

Q83.  

</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:

Q84.  

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

Q85. A web application uses a cookies to track a client as it navigates through the pages that constitutes the application. Which code snippet can be used by the web application to reduce the chance of a cross-site scripting attack by setting some property of the cookie before returning it to the client? 

A. cookie.setHttpOnly(true) 

B. cookie.setMaxAge(3600) 

C. cookie.setPath(“/”) 

D. cookie.setSecure(true) 

Answer:

Q86. A popular Ajax framework and its companion widget library contain several hundreds of files of different types (.js, .ess, .html). Your company has mandated that all its web applications use only specific versions of this framework approved by IT and repackaged internally as jar files. Furthermore, web applications should only include the entire jar, without subsetting or modification. 

Where should the framework's files be placed inside a jar file to enable this kind of reuse? 

A. under resources 

B. under META-INF/resources 

C. under META-INF/web-contents 

D. under WEB-INF/resources 

Answer:

Q87. To take advantage of the capabilities of modern browsers that use web standards, such as XHTML and CSS, your web application is being converted from simple JSP pages to JSP Document format. However, one of your JSPs, /scripts/screenFunctions.jsp, generates a JavaScript file. This file is included in several web forms to create screen-specific validation functions and are included in these pages with the following statement: 

Which JSP code snippet declares that this JSP Document is a JavaScript file? 

A. <%@ page contentType=‘application/javascript’ %> 

B. <jsp:page contentType=‘application/javascript’/> 

C. <jsp:documentcontentType=‘application/javascript’ /> 

D. <jsp:directive.pagecontentType=‘application/javascript’ /> 

E. No declaration is needed because the web form XHTML page already declares the MIME type of the /scripts/screenFunctions.jsp file in the <script> tag. 

Answer:

Q88.

 String name = (String) session.getAttribute(“name”) 

Which three can be placed at line 23 to retrieve an existing HttpSession object? (Choose three) 

A. HttpSession session = request.getSession(); 

B. HttpSession session = request.getSession(id); 

C. HttpSession session = request.getSession(true); 

D. HttpSession session = request.getSession(false); 

E. HttpSession session = request.getSession(“jsessionid”); 

Answer: ACD