In your proposed solution, you would need an external mechanism for
ensuring that the temporary file was removed in the following
exceptional case.  An RPC creates the temporary file, but the client
never calls the servlet GET to retrieve the file.  This could happen
if the user goes to a different web site in the middle of the request.

I have a similar problem.  To solve my problem, I just directly send
the form data as parameters to the servlet GET and not use an RPC.
That way there's no risk of leaking temp files.

On Fri, Dec 9, 2011 at 05:05, Appien <appienvanv...@gmail.com> wrote:
> Hi folks,
>
> At the moment I'm having troubles with starting a file download using
> GWT. In my application we have a Form object which contains all data
> which should be stored on a PDF file. Currently my applications works
> like this to generate the file and start the download.
>
> 1. Do a RPC call to store a form object in the session
> 2. If succesfull, call servlet by a GET method
> 3. Get the form object out of the session, genereate the pdf and write
> the Response object
>
> However, this solutions fails due to the fact that during the calls 2
> sessions gets created. The first one when I do an RPC call to store
> the form in the session. When the RPC call is finished the session
> gets destroyed. The second session is created when I do a call to the
> servlet. The servlet cannot find the stored Form object as the session
> in which the Form object is stored is already destroyed.
>
> How can I handle the different created sessions on the server?
>
> As GWT cannot handle file download using RPC, an alternative solution
> would be to create a tempory file. In this solution I would create a
> RPC call which creates a file with an unique filename. When this file
> is created, I call the servlet to get the file. Is this a nice
> solution for this problem or is there a more nifty solution?
>
> Regards,
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-web-toolkit?hl=en.
>



-- 
Tony Edgin
Software Architecture and Design Leader
LBT Observatory
933 N. Cherry Ave., Tucson AZ 85721-0065
p:520-626-8951, c:520-419-8821, f:520-626-9333

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to