PrepAway - Latest Free Exam Questions & Answers

Which of the following is the best way to accomplish this?

A client is to be sent to a servlet in a separate servletContext. Which of the following is the best
way to accomplish this?

PrepAway - Latest Free Exam Questions & Answers

A.
getServletConfig().getServletContext().getRequestDispatcher(“http://www.testapp.com/OtherApp/s
ervlets/OtherServlet”).forward(req,res);

B.
response.sendRedirect(“/OtherApp/servlets/OtherServlet”);

C.
getServletConfig().getServletContext().getRequestDispatcher(“/Other/servlets/OtherServlet”).forw
ard(req,res);

D.
response.sendRedirect(“http://www.testapp.com/OtherApp/servlets/OtherServlet”);


Leave a Reply