How is the ServletContext obtained in a servlet?

  • Using the getServletConfig() method of the HttpServletRequest object.
  • Using the getServletConfig() method of the ServletContext object.
  • Using the getServletContext() method of the HttpServletRequest object.
  • Using the getServletContext() method of the ServletConfig object.
The getServletContext() method of the HttpServletRequest object is used to obtain the ServletContext in a servlet.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *