For what it's worth, I successfully use this. But I don't know if
it's portlet-friendly.
OutputStream responseStream =
((HttpServletResponse)facesContext.getExternalContext().getResponse()).getOutputStream();
HttpServletResponse response =
(HttpServletResponse)facesContext.getExternalContext().getResponse();
response.setContentType(selectedContent.getContentType());
response.setHeader("Content-Disposition","attachment;filename=\""
+ selectedContent.getContentId() + "\"");
response.setContentLength(selectedContent.getContentData().getData().length);
responseStream.write(selectedContent.getContentData().getData());
response.flushBuffer();
facesContext.responseComplete();
On 4/4/06, Sébastien Marin <[EMAIL PROTECTED]> wrote:
> Hello, i'am working on BIRT printing with HTML and PDF format.
>
> So My report are OK and i can display it in HTML on a new Window.
>
> First pb : how can i open a popup in jsf? So i use Jenia popup...
>
> Second pb : to display the PDF report generates, i have to change the
> content-typt of the response. But when i am in debug, the content-type doesn't
> change and stay at "html/text". So my report isn't displayed properly.
> <-------------------------------------------------------->
> FacesContext context = FacesContext.getCurrentInstance();
> HttpServletResponse httpServletResponse =
> context.getExternalContext().getResponse();
> httpServletResponse .setContentType("application/pdf");
> <-------------------------------------------------------->
>
> I work on a jetspeed portal.
>
> Please help me to solve or understand the problem.
>
> |Cordialement, Sébastien MARIN.|
> |------------------------------|
> |-> http://www.marin-s.com <-|
> |------------------------------|
>