Ramanjeneyulu Bodepudi:
FacesContext ctx = FacesContext.getCurrentInstance();
ExternalContext ectx = ctx.getExternalContext();
HttpServletRequest request = (HttpServletRequest) ectx.getRequest();
HttpServletResponse response = (HttpServletResponse) ectx.getResponse();
RequestDispatcher dispatcher = request.getRequestDispatcher("/process");
dispatcher.forward(request, response);
ctx.responseComplete();
This is your problem. In a portal environment, the response stream is already partially written to by the time your portlet gets control. You are trying to take control back from the portal in order to output your own stream which contains the CSV file data.
Now, if you were using JSP for example, I'd tell you to turn this into a resource request (those have total access to the output stream and the portal will not have written any data in there before your code gets invoked).
The response to you is basically the same, but the caveat is that I don't know how to tell you to do that within IceFaces...
Please sign in to flag this as inappropriate.