Given the element from the web application deployment descriptor:
and given that /main/page1.jsp contains:
<% int i = 12; %> <%= i %>
What is the result?
A.
B. 12
C. The JSP fails to execute.
D. <% int i = 12 %><%= i %>
You are creating a new JSP page and you need to execute some code that acts when the page is first executed, but only once. Which three are possible mechanisms for performing this initialization code? (Choose three.)
A. In the init method.
B. In the jspInit method.
C. In the constructor of the JSP's Java code.
D. In a JSP declaration, which includes an initializer block.
E. In a JSP declaration, which includes a static initializer block.
You are writing a JSP that includes scriptlet code to declare a List variable and initializes that variable to an ArrayList object. Which two JSP code snippets can you use to import these list types? (Choose two.)
A. <%! import java.util.*; %>
B. <%! import java.util.List;import java.util.ArrayList; %>
C. <%@ page import='java.util.List'import='java.util.ArrayList' %>
D. <%@ import types='java.util.List'types='java.util.ArrayList' %>
E. <%@ page import='java.util.List,java.util.ArrayList' %>
F. <%@ import types='java.util.List,java.util.ArrayList' %>
You are building JSP pages that have a set of menus that are visible based on a user's security role. These menus are hand-crafted by your web design team; for example, the SalesManager role has a menu in the file /WEB-INF/html/salesmgr-menu.html. Which JSP code snippet should be used to make this menu visible to the user?
A. <% if ( request.isUserInRole("SalesManager") ) { %><%@ include file='/WEB-INF/html/sales- mgr- menu.html' %><% } %>
B.
C. <% if ( request.isUserInRole("SalesManager") ) { %>
D.
For debugging purposes, you need to record how many times a given JSP is invoked before the user's session has been created. The JSP's destroy method stores this information to a database. Which JSP code snippet keeps track of this count for the lifetime of the JSP page?
A. <%! int count = 0; %><% if ( request.getSession(false) == null ) count++; %>
B. <%@ int count = 0; %><% if ( request.getSession(false) == null ) count++; %>
C. <% int count = 0;if ( request.getSession(false) == null ) count++; %>
D. <%@ int count = 0;if ( request.getSession(false) == null ) count++; %>
E. <%! int count = 0;if ( request.getSession(false) == null ) count++; %>
For manageability purposes, you have been told to add a "count" instance variable to a critical JSP Document so that a JMX MBean can track how frequent this JSP is being invoked. Which JSP code snippet must you use to declare this instance variable in the JSP Document?
A.
B. <%! int count = 0; %>
C.
D.
In a JSP-centric web application, you need to create a catalog browsing JSP page. The catalog is stored as a List object in the catalog attribute of the webapp's ServletContext object. Which scriptlet code snippet gives you access to the catalog object?
A. <% List catalog = config.getAttribute("catalog"); %>
B. <% List catalog = context.getAttribute("catalog"); %>
C. <% List catalog = application.getAttribute("catalog"); %>
D. <% List catalog = servletContext.getAttribute("catalog"); %>
Which element of the web application deployment descriptor defines the servlet class associated with a servlet instance?
A.
B.
C.
D.
E.
F.
Within the web application deployment descriptor, which defines a valid JNDI environment entry?
A.
B.
C.
D.
Which three are described in the standard web application deployment descriptor? (Choose three.)
A. session configuration
B. MIME type mappings
C. context root for the application
D. servlet instance pool configuration
E. web container default port bindings
F. ServletContext initialization parameters
Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Oracle exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 1Z0-858 exam preparations and Oracle certification application, do not hesitate to visit our Vcedump.com to find your solutions here.