August 7, 2012

Getting Request and Response Object of JSF page


By using the below statements we can get the Request and Response objects of the JSF page.

(HttpServletRequest)javax.faces.context.FacesContext.getCurrentInstance().getExternalContext().getRequest();

(HttpServletResponse)javax.faces.context.FacesContext.getCurrentInstance().getExternalContext().getResponse();