Multiple choice technology programming languages

How does one acquire the object implementing RequestDispatcher interface?

  1. Using getRequestDispatcher() method of RequestDispatcher interface

  2. Using getRequestDispatcher() method of ServletContext interface

  3. Using getDispatcher() method of RequestDispatcher interface

  4. Using getDispatcher() method of ServletContext interface

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The RequestDispatcher object is obtained using the getRequestDispatcher() method of the ServletContext interface, not the RequestDispatcher interface itself. This is because ServletContext provides the context for resource dispatching within the web application.