On 12/24/05, Kedar Panse <[EMAIL PROTECTED]> wrote:
> Thanks, That would work.  But still I'll have to have FormFile in to
> ActionForm which is not seriliazable. Giving me error
>
>  IOException while loading persisted sessions: java.io.WriteAbortedException:
> writing aborted; java.io.NotSerializableException:
<snip/>

To use lazy initialization, one tends to declare the corresponding
fields transient. And you should also think about using a real
persistence layer (being in a servlet container environment).

But lets first ask:

 * Is it the intent to serialize? Why do you want FormFile's to
persist? Is this about the server failures/restarts?

 * Does it matter enough for these use cases? What is the end-user
experience that is missing, that you want to achieve?

-Rahul


>
> Kedar
>
>
> On 12/22/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
> >
> > Kedar Panse wrote:
> > > Hello gurus,
> > >
> > > I want to use a wizard type of flow where in one screen there is File
> > > Upload.  As  this is wizard, i was using session scoped formbean with
> > one
> > > property formfile.  But seems like formfile is not serializable.  What
> > is
> > > proper way of handling this?
> >
> > Given that a file could be arbitrarily large, is doesn't really make
> > sense to store it in the session. I'd suggest saving it to temporary
> > disk and replacing the reference in the form bean with the path to the
> > temporary file. You can then reload the temp file when your wizard is
> > ready to deal with it.
> >
> > So, in your action when the file upload is received, stream it to a temp
> > file, set the form bean property for the uploaded file to null, and set
> > another property to the path to the temp file. The form bean should then
> > serialize without problem, and you can get at the file later when you
> > need to.
> >
> > L.
> >
<snap/>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to