Which method is used to get a reference to the ServletContext?

  • getContext()
  • getServletConfig()
  • getServletContext()
  • init()
The getServletContext() method is used to obtain a reference to the ServletContext. It is typically called within a servlet using the this.getServletContext() or getServletContext() to access the context information.
Add your answer
Loading...

Leave a comment

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