Servlet context and faces context are two different entities then how can we get the servlet context from Java Server Face Request (JSF).Using below code we can get servlet context from JSF


ServletContext servletContext = (ServletContext) FacesContext
       .getCurrentInstance().getExternalContext().getContext();