1. get HttpServletResponse from liferay portal stackoverflow.comI am trying to get the HttpServletResponse from liferay portal. I am also working with icefaces.
I get ... |
2. How to display response(HttpServletResponse) content. icefaces.orgReportClientDocument clientDoc = buildClientDocument(report); // This method "buildClientDocument(...)" downloading file with report, joust like with JasperReport when you must download file ".jasper". CrystalReportViewer viewer = new CrystalReportViewer(); viewer.setReportSource(clientDoc.getReportSource()); FacesContext facesContext = FacesContext.getCurrentInstance(); ServletContext servletContext = (ServletContext)facesContext.getExternalContext().getContext(); HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest(); HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse(); viewer.processHttpRequest(request, response, servletContext, null); // Ok this method is important a quotation from API "Handles ... |
4. Problems with HttpServletResponse icefaces.orgHello when I click the ice command button I cant get an HttpServletResponse object from ExternalContext because its always null and I need this object becase I have to thrown an stream to the client browser. It is the code of my ice comman button: |
5. NPE getting HttpServletResponse from selectInputText action icefaces.org |
6. Getting HttpServletResponse from RenderREsponse icefaces.orgpublic class NoCachePhaseListener implements PhaseListener { public PhaseId getPhaseId() { return PhaseId.RENDER_RESPONSE; } public void afterPhase(PhaseEvent phaseEvent) { } public void beforePhase(PhaseEvent phaseEvent) { FacesContext facesContext = phaseEvent.getFacesContext(); HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse(); response.addHeader("Pragma", "no-cache"); response.addHeader("Cache-Control", "no-cache"); response.addHeader("Cache-Control", "no-store"); response.addHeader("Cache-Control", "must-revalidate"); response.addHeader("Expires", "Mon, 1 Jan 2006 05:00:00 GMT");//in the past } } |