[Free] 2018(Mar) Dumps4cert Pass4sure Oracle 1z0-899 Dumps with VCE and PDF Download 31-40

Dumps4cert.com : Latest Dumps with PDF and VCE Files 2018 Mar Oracle Official New Released 1z0-899
100% Free Download! 100% Pass Guaranteed!
http://www.Dumps4cert.com/1z0-899.html

Java EE 6 Web Component Developer Certified Expert Exam

Question No: 31

Which annotation enables a servlet to efficiently process requests of typo multipart/form- data that involve large files being uploaded by the client?

  1. @AcceptMultipart

  2. @MultiPartConfig

  3. @MultiPartFormData

  4. @WebServlet (multipart = true)

    Answer: B

    Reference: http://www.scribd.com/ilinchen2008/d/38764279-Servlet3-0-Specs (page 22, last paragraph)

    Question No: 32

    Click the Exhibit button. Given the HTML form:

    1. lt;htmlgt;

    2. lt;bodygt;

    3. lt;form action=quot;submit.jspquot;gt;

    4. Name: lt;input type=quot;textquot; name=quot;i1quot;gt;lt;brgt;

    5. Price: lt;input type=quot;textquot; name=quot;i2quot;gt;lt;brgt;

    6. lt;input type=quot;submitquot;gt;

    7. lt;/formgt;

    8. lt;/bodygt;

    9. lt;/htmlgt;

      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?

      Dumps4Cert 2018 PDF and VCE

      1. lt;jsp:useBean id=quot;com.example.Productquot; /gt;

        lt;jsp:setProperty name=quot;productquot; property=quot;*quot; /gt;

      2. lt;jsp:useBean id=quot;productquot; class=quot;com.example.Productquot; /gt;

        ${product.name = param.i1}

        ${product.price = param.i2}

      3. lt;jsp:useBean id=quot;productquot; class=quot;com.example.Productquot;gt;

        lt;jsp:setProperty name=quot;productquot; property=quot;namequot; param=quot;i1quot; /gt;

        lt;jsp:setProperty name=quot;productquot; property=quot;pricequot; param=quot;i2quot; /gt;

        lt;/jsp:useBeangt;

      4. lt;jsp:useBean id=quot;productquot; type=quot;com.example.Productquot;gt;

lt;jsp:setProperty name=quot;productquot; property=quot;namequot; value=quot;lt;%= request.getParameter( quot;i1quot; ) %gt;quot; /gt;

lt;jsp:setProperty name=quot;productquot; property=quot;pricequot; value=quot;lt;%= request.getParameter( quot;i2quot; ) %gt;quot; /gt;

lt;/jsp:useBeangt;

Answer: C

Question No: 33

Which of the following are attributes of the annotation javax.servlet.annotation.WebFiler?

->Name

->servletNames

->urlPatterns

->dispatcherTypes

->supportAsync

  1. (iii) only

  2. (iii) and (iv)

  3. (ii), (iii) and (iv)

  4. (iii), (iv) and (v)

  5. (ii), (iii), (iv) and (v)

Answer: B

Explanation: * (iii) urlPatterns

The URL patterns to which the filter applies

  • (iv) dispatcherTypes

    The dispatcher types to which the filter applies

  • (not V): asyncSupported

    Declares whether the filter supports asynchronous operation mode.

    Note:

  • javax.servlet.annotation Annotation Type WebFilter

    Annotation used to declare a servlet filter.

    This annotation is processed by the container at deployment time, and the corresponding filter applied to the specified URL patterns, servlets, and dispatcher types.

    Question No: 34

    A web application wants to register a new servlet at runtime using one of the servletContext.addServlet methods.

    In the implementation of which method is it legal to perform this operation?

    1. AsyncListner.oncomplete

    2. Servlet.init

    3. ServletContextListener.contextInitialize

    4. ServletrequestListener.contextInitialize

    Answer: C

    Question No: 35

    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?

    1. cookie.setHttpOnly(true)

    2. cookie.setMaxAge(3600)

    3. cookie.setPath(“/”)

    4. cookie.setSecure(true)

    Answer: A

    Explanation: When HTTPOnly flag is assigned to a cookie, the browser will restrict the access to such Cookie from Java Script code hence the cookie would only be sent to the subsequent request to server but cannot be accessed using client side script. In such a case even if website is vulnerable to Cross Site Scripting (XSS) attacks, still the browser would safeguard the data stored into cookies flagged as HTTPOnly.

    Incorrect:

    Not D: If Secure flag is set for Cookie then it may only be transmitted over secure channel (SSL/HTTPS) ensuring that data is always encrypted while transmitting from client to

    server.

    Question No: 36

    Which statement is true about web container session management?

    1. Access to session-scoped attributes is guaranteed to be thread-safe by the web container.

    2. To activate URL rewriting, the developer must use the HttpServletResponse.setURLRewriting method.

    3. If the web application uses HTTPS, then the web container may use the data on the HTTPS request stream to identify the client.

    4. The JSESSIONID cookie is stored permanently on the client so that a user may return to the web application and the web container will rejoin that session.

    Answer: C

    Question No: 37

    Given an HttpServletRequest request and an httpServletResponse response:

    1. HttpSession session = null;

    2. / / insert code here

    3. if (session = = null) {

    4. / / do something if session does not exist

    5. } else {

    6. / / do something if session exists

    47. }

    To implement the design intent, which statement must be inserted at line 42?

    1. session = response.getSession ();

    2. session = request.getSession ();

    3. session = request.getSession (true);

    4. session = request.getSession (false);

    5. session = request.getSession (“jsessionid”);

    Answer: D

    Question No: 38

    Which describes a trigger that causes a call to an AsyncListener?

    1. Completion of processing

    2. Receipt of a new request from the same client

    3. Addition of a new filter to the processing stream for this request

    4. Completion of each timer interval

    Answer: B

    Question No: 39

    You are implementing a model component. You realize that an IOException might arise if you lose connection to the database. How should you address this?

    1. Implement multipathing to provide redundant connectivity to the database, thereby avoiding that risk of connection failure.

    2. Provide an error handler page, and use the page directive in the invoking ISP to redirect to that page if the error arises.

    3. Use the JSTL lt;c:catchgt; tag to take control if the exception arises.

    4. Surround the problem area with a try/catch block and implement appropriate recovery or fallback behavior.

    Answer: C

    Reference: http://www.ibm.com/developerworks/java/library/j-jstl0318/ (topic: exception handling)

    Question No: 40

    Given:

    1. class MyServlet extends HttpServlet {

    2. public void doPut(HttpServletRequest req, HttpServletResponse resp)

      throws ServletException, IOException {

    3. // servlet code here

      26. }

      27. }

      If the DD contains a single security constraint associated with MyServlet and its only lt;http- methodgt; tags and lt;auth-constraintgt; tags are:

      lt;http-methodgt;GETlt;/http-methodgt;

      lt;http-methodgt;PUTlt;/http-methodgt;

      lt;auth-constraingt;Adminlt;/auth-constraingt;

      Which four requests would be allowed by the container? (Choose four)

      1. A user whose role is Admin can perform a PUT.

      2. A user whose role is Admin can perform a GET.

      3. A user whose role is Admin can perform a POST.

      4. A user whose role is Member can perform a PUT.

      5. A user whose role is Member can perform a POST.

      6. A user whose role is Member can perform a GET.

    Answer: A,B,C,E

    100% Dumps4cert Free Download!
    Download Free Demo:1z0-899 Demo PDF
    100% Dumps4cert Free Guaranteed!
    1z0-899 Dumps

    Dumps4cert ExamCollection Testking
    Lowest Price Guarantee Yes No No
    Up-to-Dated Yes No No
    Real Questions Yes No No
    Explanation Yes No No
    PDF VCE Yes No No
    Free VCE Simulator Yes No No
    Instant Download Yes No No

Leave a Reply

Your email address will not be published. Required fields are marked *