📚 Practice Mode

Java Programming and OOP Concepts

Learn at your own pace with hints and detailed explanations

1 / 11
Multiple Choice

From the available options, what is the likely outcome from running the code below? (Choose one.) protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { RequestDispatcher dispatcher = getServletContext().getNamedDispatcher("/ServletB"); dispatcher.forward(request, response); }

  1. DispatcherNotFoundException.
  2. Runtime error because of incorrectly formed parameter to getNamedDispatcher() method.
  3. NullPointerException.
  4. ServletB can obtain request attribute javax.servlet.forward.request_uri.