// Get the ServletContext object ServletContext context = getServletContext(); // Get the value of a parameter from web.xml String paramValue = context.getInitParameter("myParam");
// Get the ServletContext object ServletContext context = getServletContext(); // Get a file resource relative to the web application root InputStream input = context.getResourceAsStream("/WEB-INF/config.properties");Package Library: javax.servlet package belongs to the Java Servlet API, which is a standard component of the Java EE platform. It is provided by Oracle Corporation and can be found in the servlet-api.jar file.