aruna sameera wrote:if genericServlet class implement servlet interface every servlet implicitily have servletContext methods.
By the way Servlet interface doesnt have getServletContext(). ServletConfig has the getServletContext() and GenericServlet gives the implementation which is Super class of HttpServlet . look
Here.
So you can do like below in your servlet
this what you want to know?