Am Saturday 20 August 2005 13:07 schrieb Tim Peteler:
> Further information on:
> http://www.onjava.com/pub/a/onjava/excerpt/java_cookbook_ch18/?page=6
Thanks, my servlet looks similar ;-)
> I solved this problem this way:
>
> public void exportFile() {
> FacesContext context = FacesContext.getCurrentInstance();
> HttpServletResponse response =
> (HttpServletResponse)context.getExternalContext().getResponse();
> response.setContentType("application/pdf");
> response.setHeader("Content-disposition",
> "inline=filename=file.pdf");
>
> try {
> response.getOutputStream().write(yourdata[]);
> response.getOutputStream().flush();
> response.getOutputStream().close();
> context.responseComplete();
And that works? How do you call this method? My first try looked exactly like
this but I had the very exact problem that I described: every further click
of the user worked only the second time.
Carsten