JSF(request response)对象的获取

import javax.faces.context.FacesContext;

HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();

HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();


下面的说明创建一个新页面!

FacesContext facesContext= FacesContext.getCurrentInstance();
response.getWriter().print("OK!");
facesContext.responseComplete();
return null;

你可能感兴趣的:(JSF)