Pass4itsure > Oracle > Others Oracle Certifications > 1Z0-858 > 1Z0-858 Online Practice Questions and Answers

1Z0-858 Online Practice Questions and Answers

Questions 4

Given a servlet mapped to /control, place the correct URI segment returned as a String on the corresponding HttpServletRequest method call for the URI: /myapp/control/processorder.

Select and Place:

Select and Place:

Buy Now
Questions 5

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"); %>

Buy Now
Questions 6

Assume that a news tag library contains the tags lookup and item:

lookup Retrieves the latest news headlines and executes the tag body once for each headline. Exposes a NESTED page-scoped attribute called headline of type com.example.Headline containing details for that headline.

item Outputs the HTML for a single news headline. Accepts an attribute info of type com.example.Headline containing details for the headline to be rendered.Which snippet of JSP code returns the latest news headlines in an HTML table, one per row?

A. [table]

B. [table]

C. [table]

D. [table]

Buy Now
Questions 7

You have a simple web application that has a single Front Controller servlet that dispatches to JSPs to generate a variety of views. Several of these views require further database processing to retrieve the necessary order object using the orderID request parameter. To do this additional processing, you pass the request first to a servlet that is mapped to the URL pattern /WEB-INF/retreiveOrder.do in the deployment descriptor. This servlet takes two request parameters, the orderID and the jspURL. It handles the database calls to retrieve and build the complex order objects and then it dispatches to the jspURL.

Which code snippet in the Front Controller servlet dispatches the request to the order retrieval servlet?

A. request.setAttribute("orderID", orderID);request.setAttribute("jspURL", jspURL);RequestDispatcher view= context.getRequestDispatcher("/WEB- INF/retreiveOrder.do");view.forward(request, response);

B. request.setParameter("orderID", orderID);request.setParameter("jspURL", jspURL);Dispatcher view= request.getDispatcher("/WEB-INF/retreiveOrder.do");view.forwardRequest(request, response);

C. String T="/WEB-INF/retreiveOrder.do?orderID=%dandjspURL=%s";String url = String.format(T, orderID, jspURL);RequestDispatcher view= context.getRequestDispatcher(url);view.forward(request, response);

D. String T="/WEB-INF/retreiveOrder.do?orderID=%dandjspURL=%s";String url = String.format(T, orderID, jspURL);Dispatcher view= context.getDispatcher(url);view.forwardRequest(request, response);

Buy Now
Questions 8

Click the Exhibit button.

Given the HTML form:

1.

2.

3.

4.

Name:

5.

Price:

6.

7.

8.

9.

Assume the product attribute does NOT yet exist in any scope.

Which code snippet, in submit.jsp, instantiates an instance of com.example.Product that contains the results of the form submission?

A.

B. ${product.name = param.i1}$ {product.price = param.i2}

C.

D. " />" />

Buy Now
Questions 9

Every page of your web site must include a common set of navigation menus at the top of the page. This menu is static HTML and changes frequently, so you have decided to use JSP's static import mechanism. Which JSP code snippet accomplishes this goal?

A. <%@ import file='/common/menu.html' %>

B. <%@ page import='/common/menu.html' %>

C. <%@ import page='/common/menu.html' %>

D. <%@ include file='/common/menu.html' %>

E. <%@ page include='/common/menu.html' %>

F. <%@ include page='/common/menu.html' %>

Buy Now
Questions 10

If you want to use the Java EE platform's built-in type of authentication that uses a custom HTML page for authentication, which two statements are true? (Choose two.)

A. Your deployment descriptor will need to contain this tag:CUSTOM.

B. The related custom HTML login page must be named loginPage.html.

C. When you use this type of authentication, SSL is turned on automatically.

D. You must have a tag in your deployment descriptor that allows you to point to both a login HTML page and an HTML page for handling any login errors.

E. In the HTML related to authentication for this application, you must use predefined variable names for the variables that store the user and password values.

Buy Now
Questions 11

You need to store a floating point number, called Tsquare, in the session scope. Which two code snippets allow you to retrieve this value? (Choose two.)

A. float Tsquare = session.getFloatAttribute("Tsquare");

B. float Tsquare = (Float) session.getAttribute("Tsquare");

C. float Tsquare = (float) session.getNumericAttribute("Tsquare");

D. float Tsquare = ((Float) session.getAttribute.("Tsquare")).floatValue();

E. float Tsquare = ((Float) session.getFloatAttribute.("Tsquare")).floatValue;

F. float Tsquare = ((Float) session.getNumericAttribute.("Tsquare")).floatValue;

Buy Now
Questions 12

Given this fragment from a Java EE deployment descriptor:

341.

342.

java.lang.Throwable 343. /mainError.jsp 344.

345.

346.

java.lang.ClassCastException 347. /castError.jsp

348.

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.

Buy Now
Questions 13

What is the purpose of session management?

A. To manage the user's login and logout activities.

B. To store information on the client-side between HTTP requests.

C. To store information on the server-side between HTTP requests.

D. To tell the web container to keep the HTTP connection alive so it can make subsequent requests without the delay of making the TCP connection.

Buy Now
Exam Code: 1Z0-858
Exam Name: Java Enterprise Edition 5 Web Component Developer Certified Professional Exam
Last Update: Apr 15, 2024
Questions: 276
10%OFF Coupon Code: SAVE10

PDF (Q&A)

$45.99

VCE

$49.99

PDF + VCE

$59.99