1Z0-858 Exam Details

  • Exam Code
    :1Z0-858
  • Exam Name
    :Java Enterprise Edition 5 Web Component Developer Certified Professional
  • Certification
    :Oracle Certifications
  • Vendor
    :Oracle
  • Total Questions
    :276 Q&As
  • Last Updated
    :Jul 12, 2026

Oracle 1Z0-858 Online Questions & Answers

  • Question 41:

    As a convenience feature, your web pages include an Ajax request every five minutes to a special servlet that monitors the age of the user's session. The client-side JavaScript that handles the Ajax callback displays a message on the screen as the session ages. The Ajax call does NOT pass any cookies, but it passes the session ID in a request parameter called sessionID. In addition, assume that your webapp keeps a hashmap of session objects by the ID. Here is a partial implementation of this servlet:

    10.

    public class SessionAgeServlet extends HttpServlet {

    11.

    public void service(HttpServletRequest request, HttpServletResponse) throws IOException {

    12.

    String sessionID = request.getParameter("sessionID");

    13.

    HttpSession session = getSession(sessionID);

    14.

    long age = // your code here

    15.

    response.getWriter().print(age);

    16.

    } ... // more code here

    47. }

    Which code snippet on line 14, will determine the age of the session?

    A. session.getMaxInactiveInterval();
    B. session.getLastAccessed().getTime() - session.getCreationTime().getTime();
    C. session.getLastAccessedTime().getTime() - session.getCreationTime().getTime();
    D. session.getLastAccessed() - session.getCreationTime();
    E. session.getMaxInactiveInterval() - session.getCreationTime();
    F. session.getLastAccessedTime() - session.getCreationTime();

  • Question 42:

    Given a request from mybox.example.com, with an IP address of 10.0.1.11 on port 33086, place the appropriate ServletRequest methods onto their corresponding return values.

    Select and Place:

  • Question 43:

    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.

  • Question 44:

    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?

  • Question 45:

    A developer has used this code within a servlet:

    62.

    if(request.isUserInRole("vip")) {

    63.

    // VIP-related logic here

    64.

    }

    What else must the developer do to ensure that the intended security goal is achieved?

    A. create a user called vip in the security realm
    B. define a group within the security realm and call it vip
    C. define a security-role named vip in the deployment descriptor
    D. declare a security-role-ref for vip in the deployment descriptor

  • Question 46:

    One of the use cases in your web application uses many session-scoped attributes. At the end of the use case, you want to clear out this set of attributes from the session object. Assume that this static variable holds this set of attribute names:

    201.

    private static final Set USE_CASE_ATTRS;

    202.

    static {

    203.

    USE_CASE_ATTRS.add("customerOID");

    204.

    USE_CASE_ATTRS.add("custMgrBean");

    205.

    USE_CASE_ATTRS.add("orderOID");

    206.

    USE_CASE_ATTRS.add("orderMgrBean");

    207.

    }

    Which code snippet deletes these attributes from the session object?

    A. session.removeAll(USE_CASE_ATTRS);
    B. for ( String attr : USE_CASE_ATTRS ) {session.remove(attr);}
    C. for ( String attr : USE_CASE_ATTRS ) {session.removeAttribute(attr);}
    D. for ( String attr : USE_CASE_ATTRS ) {session.deleteAttribute(attr);}
    E. session.deleteAllAttributes(USE_CASE_ATTRS);

  • Question 47:

    A developer is designing a web application that must verify for each request:

    The originating request is from a trusted network.

    The client has a valid session.

    The client has been authenticated.

    Which design pattern provides a solution in this situation?

    A. Transfer Object
    B. Session Facade
    C. Intercepting Filter
    D. Template Method
    E. Model-View-Controller

  • Question 48:

    You have created a servlet that generates weather maps. The data for these maps is calculated by a remote host. The IP address of this host is usually stable, but occasionally does have to change as the corporate network grows and changes. This IP address used to be hard coded, but after the fifth change to the IP address in two years, you have decided that this value should be declared in the deployment descriptor so you do NOT have the recompile the web application every time the IP address changes. Which deployment descriptor snippet accomplishes this goal?

    A. WeatherServlet.hostIP127.0.4.20
    B. WeatherServlet.hostIP127.0.4.20
    C. WeatherServlet.hostIP127.0.4.20
    D. WeatherServlet.hostIP127.0.4.20
    E. WeatherServlet.hostIP127.0.4.20

  • Question 49:

    You want to create a filter for your web application and your filter will implement javax.servlet.Filter.

    Which two statements are true? (Choose two.)

    A. Your filter class must implement an init method and a destroy method.
    B. Your filter class must also implement javax.servlet.FilterChain.
    C. When your filter chains to the next filter, it should pass the same arguments it received in its doFilter method.
    D. The method that your filter invokes on the object it received that implements javax.servlet.FilterChain can invoke either another filter or a servlet.
    E. Your filter class must implement a doFilter method that takes, among other things, an HTTPServletRequest object and an HTTPServletResponse object.

  • Question 50:

    Given this fragment from a Java EE deployment descriptor:

    124.

    beta.html

    125.

    alpha.html

    And this request from a browser:

    http://www.sun.com/SCWCDtestApp/register

    Which statement is correct, when the container receives this request?

    A. This deployment descriptor is NOT valid.
    B. The container first looks in the register directory for beta.html.
    C. The container first looks in the register directory for alpha.html.
    D. The container first looks for a servlet mapping in the deployment descriptor.

Tips on How to Prepare for the Exams

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.