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,
Now you can act like a normal servlet; Override do post, read params,
write file.
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.
> --
> 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-we...@googlegroups.com.
> To unsubscribe from this group, send email to google-web-tool...@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
I see the problem Tony mentioned. Is there not another way to store
the object which contains all data temporary on the server? By
something like a special session which has a different expiration
time?
> > For more options, visit this group athttp://groups.google.com/group/google-web-toolkit?hl=en.