commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <mfncoo...@gmail.com>
Subject Re: DiskFileUpload.parseRequest returns no items
Date Tue, 05 Oct 2004 16:38:30 GMT
On Tue, 5 Oct 2004 12:28:58 -0400, Ivan Vasquez <ivan@itos.uga.edu> wrote:
> I wish I could. This form is a complex one, the main thing being it has
> multiple collections for multiple-choice items.
> 
> The only workaround is probably to make the file upload a different
> page/form/action. But since user requirements dictate that a pic *must*
> be submitted at the time the record is created, validation becomes
> significantly more complicated.
> 
> Had I have access to the "original" HttpServletRequest, I could use
> commonsfileupload directly and problem solved. Struts (and therefore,
> sessions) would be unaware of the unserializable object.

You can do this if you need to, since you can disable Struts'
multipart handling and/or not use an ActionForm for that request,
either of which would leave the request input stream for you to parse
however you wish.

Alternatively, you could modify the Struts multipart handler so that
the object is serializable. Take a look at
CommonsMultipartRequestHandler in Struts - that's the class you'd want
to change. (If you decide to go this route, and you find a clean way
to make the object serializable, feel free to post back a patch! ;)

--
Martin  Cooper


> 
> Ivan.
> 
> 
> 
> -----Original Message-----
> From: Martin Cooper [mailto:mfncooper@gmail.com]
> Sent: Tuesday, October 05, 2004 12:01 PM
> To: Jakarta Commons Users List
> Subject: Re: DiskFileUpload.parseRequest returns no items
> 
> On Tue, 5 Oct 2004 11:14:15 -0400, Ivan Vasquez <ivan@itos.uga.edu>
> wrote:
> > I was pretty happy using struts upload until we moved the application
> to
> > a tomcat cluster. If the form is session-scoped and contains a
> FormFile,
> > the cluster encounters problems serializing it (an underlying class is
> > not serializable), so session replication will fail and the
> application
> > breaks.
> 
> Why not just use request-scoped forms instead?
> 
> --
> Martin Cooper
> 
> > That's how I got to commons fileupload, to avoid placing the uploaded
> > file into anything that's session-scoped. Now at least I know that I
> > can't go that way :-\
> >
> > Thank you.
> > Ivan.
> >
> >
> >
> > -----Original Message-----
> > From: Martin Cooper [mailto:mfncooper@gmail.com]
> > Sent: Monday, October 04, 2004 10:38 PM
> > To: Jakarta Commons Users List
> > Subject: Re: DiskFileUpload.parseRequest returns no items
> >
> > File upload is already supported by Struts, so you don't have to worry
> > about how to use Commons FileUpload yourself. If you try to do so, the
> > result you are seeing is to be expected, since Struts has already
> > parsed the request, and it is no longer available for your code to
> > also parse.
> >
> > For information on how to use the file upload capabilities in Struts,
> > see:
> >
> > http://wiki.apache.org/struts/StrutsFileUpload
> >
> > --
> > Martin Cooper
> >
> > On Mon, 4 Oct 2004 10:04:16 -0400, Ivan Vasquez <ivan@itos.uga.edu>
> > wrote:
> > > I'm trying to use commons.fileupload from struts to avoid having
> > > uploaded files be part of the session.
> > >
> > > Following the simplest example I attempt to parsePequest but it does
> > not
> > > return any items. I verified the request and it does contains what
> I'm
> > > expecting. The form's enctype is multipart/form-data. I'm using the
> > > current release, 1.0.
> > >
> > > Thanks in advance.
> > > Ivan
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message