xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Manuel Mall ...@arcus.com.au>
Subject Re: Is there a way to stop the creation of a PDF when the user close the browser windows?
Date Wed, 21 Sep 2005 01:49:02 GMT
On Wed, 21 Sep 2005 08:38 am, David Gagnon wrote:
> Hi thanks for you answer,
>
> >The short answer is no - there is no means in the FOP API to
> > interrupt a rendering run.
> >
> >The long answer is more like: it depends. What's your environment?
> > How do you invoke FOP? How do you serve the data to the client? For
> > example if you invoke FOP as a spawned process you could simply
> > kill it.
>
> It`s run in a servlet.

In that case you most likely can't interrupt it at least not with the 
published API.

>
> >You also said that you must wait for the report to be generated
> > before starting to send it. There is no intrinsic need to do that
> > but may be your application architecture requires that.
>
> No doesn`t need it but I thought it`s was a limitation of the
> environnement since we need to set the  Content Length in the anwser
> before sending the data i.e.:
> response.setContentLength(content.length);
>
> Is there a way to avoid that .. That will be so nice?
>
I don't think so if backwards compatibility with IE 5 and older browsers 
is important.

> I know when I generate an HTML report I get a
> java.net.SocketException when I close the browser window while the
> report is generated and send over the internet).  Is there a way I
> can test if the socket is still open while I generate the report?
Again, I don't think so. Until you write to the outputstream and the 
outputstream actually attempts to write to the underlying socket which 
may not happen until it flushes its buffers you won't know if the 
connection is still up. And if all this goes through a frontend like 
Apache who knows what happens as the servlet outputstream actually goes 
to the Apache connector and it is Apache who manages the connection to 
the client browser.

>
> >For example in a servlet
> >type environment you could connect the fop outputstream directly to
> > the servlet outputstream.
>
> I worked this problem a while ago .. but your telling my I don't need
> to set the content length ?!  My solution need to work with IE too
> ...
>
>
> Thanks for your help !
>
> /David
>
> >My recommendation - just catch the exception and do any cleanup
> >required.
> >
> >Manuel

Sorry, but it seems you are stuck with leaving it as it is know and just 
deal with the exception.

<snip/>

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message