javax.servlet.http.HttpServletRequest httpRequest = (javax.servlet.http.HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
javax.servlet.http.HttpSession session = (javax.servlet.http.HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(true);
javax.servlet.ServletContext context = (javax.servlet.ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext();This code retrieves the ServletContext object, which provides information about the web application and enables interaction with other servlets in the same context. The package library for javax.faces.context is javax.faces-api-2.3.0.jar as this is part of the JavaServer Faces (JSF) API.