Re: GWT and Generated file download

2011-12-11 Thread kim young ill
depends how long u wanna keep the files. u can store files somewhere, put
filepath in session, when session got destroyed ( put a listener in
contextlistener), read out the paths and remove them.

hth



On Mon, Dec 12, 2011 at 8:17 AM, Appien  wrote:

> Thanks so far. Unfortunately the application contains more than 8
> forms with more than 60 fields. The mapping to object and to a file
> mechanism is already built in the past. This would make the solution
> to change the forms to use a FormPanel and setting all the parameters
> a solution which requires a lot of work (which we don't have :( )
>
> 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?
>
> On Dec 9, 5:34 pm, Tony Edgin  wrote:
> > 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 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 athttp://
> 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.
>
>

-- 
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.



Re: GWT and Generated file download

2011-12-11 Thread Appien
Thanks so far. Unfortunately the application contains more than 8
forms with more than 60 fields. The mapping to object and to a file
mechanism is already built in the past. This would make the solution
to change the forms to use a FormPanel and setting all the parameters
a solution which requires a lot of work (which we don't have :( )

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?

On Dec 9, 5:34 pm, Tony Edgin  wrote:
> 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 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 
> > athttp://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.



Re: GWT and Generated file download

2011-12-09 Thread Tony Edgin
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  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.



Re: GWT and Generated file download

2011-12-09 Thread Jim Douglas
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/8c708ac2da186d17/ca92d9d8f78a0e19

On Dec 9, 4:05 am, Appien  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.



Re: GWT and Generated file download

2011-12-09 Thread Eric Metcalf
Skip doing the RPC request.  Create a file HttpServlet (don't forget
to add it to web.xml).  Use the FormPanel (http://google-web-
toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/
ui/FormPanel.html) and set the Action to the file HttpServlet.

Now you can act like a normal servlet; Override do post, read params,
write file.


On Dec 9, 6:05 am, Appien  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.



GWT and Generated file download

2011-12-09 Thread Appien
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.