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

1Z0-858 Online Practice Questions and Answers

Questions 4

Given the JSP code:

<% request.setAttribute("foo", "bar"); %> and the Classic tag handler code:

5.

public int doStartTag() throws JspException {

6.

// insert code here

7.

// return int

8.

}

Assume there are no other "foo" attributes in the web application.

Which invocation on the pageContext object, inserted at line 6, assigns "bar" to the variable x?

A. String x = (String) pageContext.getAttribute("foo");

B. String x = (String) pageContext.getRequestScope("foo");

C. It is NOT possible to access the pageContext object from within doStartTag.

D. String x = (String)pageContext.getRequest().getAttribute("foo");

E. String x = (String) pageContext.getAttribute("foo",PageContext.ANY_SCOPE);

Buy Now
Questions 5

You want to create a valid directory structure for your Java EE web application, and your application uses tag files and a JAR file. Which three must be located directly in your WEB-INF directory (NOT in a subdirectory of WEB-INF)? (Choose three.)

A. The JAR file

B. A directory called lib

C. A directory called tags

D. A directory called TLDs

E. A directory called classes

F. A directory called META-INF

Buy Now
Questions 6

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 7

Click the Exhibit button. Given:

11.

<% com.example.Advisor advisor = new com.example.Advisor(); %>

12.

<% request.setAttribute("foo", advisor); %>

Assuming there are no other "foo" attributes in the web application, which three are valid EL expressions for retrieving the advice property of advisor? (Choose three.)

A. ${foo.advice}

B. ${request.foo.advice}

C. ${requestScope.foo.advice}

D. ${requestScope[foo[advice]]}

E. ${requestScope["foo"]["advice"]}

F. ${requestScope["foo"["advice"]]}

Buy Now
Questions 8

Click the Exhibit button.

Given:

10.

11.

Product Name:

12.

Product Price:

13.

For a given product instance, which three jsp:setProperty attributes must be used to initialize its properties from the HTML form? (Choose three.)

A. id

B. name

C. type

D. param

E. property

F. reqParam

G. attribute

Buy Now
Questions 9

Which basic authentication type is optional for a J2EE 1.4 compliant web container?

A. HTTP Basic Authentication

B. Form Based Authentication

C. HTTP Digest Authentication

D. HTTPS Client Authentication

Buy Now
Questions 10

You are designing an n-tier Java EE application. You have already decided that some of your JSPs will need to get data from a Customer entity bean. You are trying to decide whether to use a Customer stub object or a Transfer Object. Which two statements are true? (Choose two.)

A. The stub will increase network traffic.

B. The Transfer Object will decrease data staleness.

C. The stub will increase the logic necessary in the JSPs.

D. In both cases, the JSPs can use EL expressions to get data.

E. Only the Transfer Object will need to use a Business Delegate.

F. Using the stub approach allows you to design the application without using a Service Locator.

Buy Now
Questions 11

Your IT department is building a lightweight Front Controller servlet that invokes an application logic object with the interface:

public interface ApplicationController { public String invoke(HttpServletRequest request) }

The return value of this method indicates a symbolic name of the next view. From this name, the Front Controller servlet looks up the JSP URL in a configuration table. This URL might be an absolute path or a path relative to the current request. Next, the Front Controller servlet must send the request to this JSP to generate the view. Assume that the servlet variable request is assigned the current HttpServletRequest object and the variable context is assigned the webapp's ServletContext.

Which code snippet of the Front Controller servlet accomplishes this goal?

A. Dispatcher view= context.getDispatcher(viewURL);view.forwardRequest(request, response);

B. Dispatcher view= request.getDispatcher(viewURL);view.forwardRequest(request, response);

C. RequestDispatcher view= context.getRequestDispatcher(viewURL);view.forward(request, response);

D. RequestDispatcher view= request.getRequestDispatcher(viewURL);view.forward(request, response);

Buy Now
Questions 12

Given that a web application consists of two HttpServlet classes, ServletA and ServletB, and the ServletA.service method:

20.

String key = "com.example.data";

21.

session.setAttribute(key, "Hello");

22.

Object value = session.getAttribute(key);

23.

Assume session is an HttpSession, and is not referenced anywhere else in ServletA.

Which two changes, taken together, ensure that value is equal to "Hello" on line 23? (Choose two.)

A. ensure that the ServletB.service method is synchronized

B. ensure that the ServletA.service method is synchronized

C. ensure that ServletB synchronizes on the session object when setting session attributes

D. enclose lines 21-22 in a synchronized block:synchronized(this) {session.setAttribute(key, "Hello");value = session.getAttribute(key);}

E. enclose lines 21-22 in a synchronized block:synchronized(session) {session.setAttribute(key, "Hello");value = session.getAttribute(key);}

Buy Now
Questions 13

Which retrieves all cookies sent in a given HttpServletRequest request?

A. request.getCookies()

B. request.getAttributes()

C. request.getSession().getCookies()

D. request.getSession().getAttributes()

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

PDF (Q&A)

$49.99

VCE

$55.99

PDF + VCE

$65.99