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?
A.
ASyncContext.dispatch();
B.
AsyncContext.dispatch(“/url”);
C.
AsyncContext.dispatch(servletContext, “/url”);
D.
AsyncContext.start(runnable);
E.
RequestDispatcher.fotward(“/url”);
F.
RequestDispatcher.forward(servletContext, “/url”);
G.
RequestDispatcher.include(“/url”);
B
A B
B&C are correct
A: dispatches the request back to the container http://docs.oracle.com/javaee/6/api/javax/servlet/AsyncContext.html
C
Only C is correct in this question because the additional parameter (ServletContext) is not necessary here. Remember the ask is “the same Servlet Context”.