Oracle 1z0-899 Exam Practice Questions (P. 4)
- Full Access (108 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #16
In ServletContext.getNamedDispatcher(string arg0) arg0 is the
- Aurl of a servlet relative to the ServletRequest
- Burl of a servlet relative to the Context
- Cname of a servlet
- Dabsolute url to any servlet in any Context
Correct Answer:
C
C
send
light_mode
delete
Question #17
When using Servlet asynchronous API if you want to dispatch the request back to a particular url -"/url" within the same Servlet Context which of the following API would you use?
- AASyncContext.dispatch();
- BAsyncContext.dispatch("/url");
- CAsyncContext.dispatch(servletContext, "/url");
- DAsyncContext.start(runnable);
- ERequestDispatcher.fotward("/url");
- FRequestDispatcher.forward(servletContext, "/url");
- GRequestDispatcher.include("/url");
Correct Answer:
B
Reference:
http://blogs.oracle.com/enterprisetechtips/entry/asynchronous_support_in_servlet_3
(Topic: AsyncContext Class, third paragraph)
B
Reference:
http://blogs.oracle.com/enterprisetechtips/entry/asynchronous_support_in_servlet_3
(Topic: AsyncContext Class, third paragraph)
send
light_mode
delete
Question #18
Which describes a trigger that causes a call to an AsyncListener?
- ACompletion of processing
- BReceipt of a new request from the same client
- CAddition of a new filter to the processing stream for this request
- DCompletion of each timer interval
Correct Answer:
A
A
send
light_mode
delete
Question #19
Refer to the Exhibit.

A servlet sets a session-scoped attribute product with an instance of com.example.product an forward to a JSP. Which two output the name of the product in the response? (Choose two)

A servlet sets a session-scoped attribute product with an instance of com.example.product an forward to a JSP. Which two output the name of the product in the response? (Choose two)
- A<%= product.getName() %>
- B<jsp:useBean id="product" class="com.example.Product" /> <%= product.getName() %>
- C<jsp:useBean id="com.example.Product" scope="page"> <%= product.getName() %> </jsp:useBean>
- D<jsp:useBean id="product" type="com.example.Product" scope="page" /> <%= product.getName() %>
- E<jsp:useBean id="product" type="com.example.Product"> <%= product.getName() %>
Correct Answer:
BC
BC
send
light_mode
delete
Question #20
Click the Exhibit button.
Given the HTML form:
1. <html>
2. <body>
3. <form action="submit.jsp">
4. Name: <input type="text" name="i1"><br>
5. Price: <input type="text" name="i2"><br>
6. <input type="submit">
7. </form>
8. </body>
9. </html>
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?

Given the HTML form:
1. <html>
2. <body>
3. <form action="submit.jsp">
4. Name: <input type="text" name="i1"><br>
5. Price: <input type="text" name="i2"><br>
6. <input type="submit">
7. </form>
8. </body>
9. </html>
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<jsp:useBean id="com.example.Product" /> <jsp:setProperty name="product" property="*" />
- B<jsp:useBean id="product" class="com.example.Product" /> ${product.name = param.i1} ${product.price = param.i2}
- C<jsp:useBean id="product" class="com.example.Product"> <jsp:setProperty name="product" property="name" param="i1" /> <jsp:setProperty name="product" property="price" param="i2" /> </jsp:useBean>
- D<jsp:useBean id="product" type="com.example.Product"> <jsp:setProperty name="product" property="name" value="<%= request.getParameter( "i1" ) %>" /> <jsp:setProperty name="product" property="price" value="<%= request.getParameter( "i2" ) %>" />
Correct Answer:
C
C
send
light_mode
delete
All Pages