Adv Java Quiz 2
Adv Java Quiz 2
You being a software developer needs to develop a web application for your
organization. You decided to use servlets to create the web application. While you
are creating the servlet you feel the need to write the code for the initialization
of the servlet. This is needed to initialize the servlet with the required data
after the servlet instance has been created. How will you perform this task?
A. RequestDispatcher dispatcher =
request.getRequestDispatcher("Servlet2"); dispatcher.forward(req, resp);
B. RequestDispatcher dispatcher =
request.getRequestDispatcher("Servlet2"); dispatcher.dispatch(req, resp);
C. RequestDispatcher dispatcher =
request.getRequestDispatcher("Servlet2"); dispatcher.chain(req, resp);
D. request.sendRedirect("Servlet2");
A. ServletRequest
B. ServletResponse
C. PrintStream
D. ServletConfig
A. footer
B. header
C. Application ID
D. Session ID
A. ServletRequest
B. ServletResponse
C. PrintStream
D. ServletConfig
A. TRUE
B. FALSE