You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Dhiren Bhatia <dh...@gmail.com> on 2005/10/08 20:22:23 UTC
Multipart Request
Hi all,
I'm having trouble with the HttpServletRequest object if my post contains
multipart data. The request object loses all the parameters set from the
html form.
i.e. request.getParameter("myParam"); always returns null. If I remove the
multipart encoding from my form, I see the parameter values.
If I use the OReilly MultipartRequest, the constructor needs me to set the
directory to save the file in so I cannot make that value dynamic by
receiving it from the HTTP post. I want to receive the dir name where the
file will be saved from the HTML form.
Any ideas? Hope this makes sense.
Thanks,
-D
Re: Multipart Request
Posted by Dakota Jack <da...@gmail.com>.
You either have to stop using ActionForm or go in and rewrite the code
on multiparts. The existing code is really sloppy and bad. There are
references that do nothing. Others do things they shouldn't do, etc.
Essentially, you really should avoid using it and write your own
implementation of the commons implementation. Unfortunately, Martin
Cooper has his finger in both pies and really does not play with
others on this. He just keeps it to himself pretty much. If you want
to get a snapshot before the next unrehearsed release, better do it
now.
On 10/9/05, Dhiren Bhatia <dh...@gmail.com> wrote:
> Yea, I'm using Struts. I like some of its features so I want to continue
> using it. But multipart is a mess. So, is there any way to retain the
> parameters in HTTPServletRequest?
>
> Thanks.
>
>
> On 10/9/05, Dakota Jack <da...@gmail.com> wrote:
> >
> > Are you using Struts? Struts has a bizarre idea that causes this type
> > of problem.
> >
> >
> >
> > On 10/8/05, Dhiren Bhatia < dhiren9@gmail.com> wrote:
> > > Hi all,
> > > I'm having trouble with the HttpServletRequest object if my post
> contains
> > > multipart data. The request object loses all the parameters set from the
> > > html form.
> > > i.e. request.getParameter("myParam"); always returns null. If I remove
> the
> > > multipart encoding from my form, I see the parameter values.
> > > If I use the OReilly MultipartRequest, the constructor needs me to set
> the
> > > directory to save the file in so I cannot make that value dynamic by
> > > receiving it from the HTTP post. I want to receive the dir name where
> the
> > > file will be saved from the HTML form.
> > > Any ideas? Hope this makes sense.
> > > Thanks,
> > > -D
> > >
> > >
> >
> >
> > --
> > "You can lead a horse to water but you cannot make it float on its back."
> > ~Dakota Jack~
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> >
> >
>
>
--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Multipart Request
Posted by Dhiren Bhatia <dh...@gmail.com>.
Yea, I'm using Struts. I like some of its features so I want to continue
using it. But multipart is a mess. So, is there any way to retain the
parameters in HTTPServletRequest?
Thanks.
On 10/9/05, Dakota Jack <da...@gmail.com> wrote:
>
> Are you using Struts? Struts has a bizarre idea that causes this type
> of problem.
>
>
>
> On 10/8/05, Dhiren Bhatia <dh...@gmail.com> wrote:
> > Hi all,
> > I'm having trouble with the HttpServletRequest object if my post
> contains
> > multipart data. The request object loses all the parameters set from the
> > html form.
> > i.e. request.getParameter("myParam"); always returns null. If I remove
> the
> > multipart encoding from my form, I see the parameter values.
> > If I use the OReilly MultipartRequest, the constructor needs me to set
> the
> > directory to save the file in so I cannot make that value dynamic by
> > receiving it from the HTTP post. I want to receive the dir name where
> the
> > file will be saved from the HTML form.
> > Any ideas? Hope this makes sense.
> > Thanks,
> > -D
> >
> >
>
>
> --
> "You can lead a horse to water but you cannot make it float on its back."
> ~Dakota Jack~
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
Re: Multipart Request
Posted by Dakota Jack <da...@gmail.com>.
Are you using Struts? Struts has a bizarre idea that causes this type
of problem.
On 10/8/05, Dhiren Bhatia <dh...@gmail.com> wrote:
> Hi all,
> I'm having trouble with the HttpServletRequest object if my post contains
> multipart data. The request object loses all the parameters set from the
> html form.
> i.e. request.getParameter("myParam"); always returns null. If I remove the
> multipart encoding from my form, I see the parameter values.
> If I use the OReilly MultipartRequest, the constructor needs me to set the
> directory to save the file in so I cannot make that value dynamic by
> receiving it from the HTTP post. I want to receive the dir name where the
> file will be saved from the HTML form.
> Any ideas? Hope this makes sense.
> Thanks,
> -D
>
>
--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Multipart Request
Posted by James Black <jb...@ieee.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dhiren Bhatia wrote:
> Hi all,
> I'm having trouble with the HttpServletRequest object if my post contains
> multipart data. The request object loses all the parameters set from the
> html form.
> i.e. request.getParameter("myParam"); always returns null. If I remove the
> multipart encoding from my form, I see the parameter values.
> If I use the OReilly MultipartRequest, the constructor needs me to set the
> directory to save the file in so I cannot make that value dynamic by
> receiving it from the HTTP post. I want to receive the dir name where the
> file will be saved from the HTML form.
> Any ideas? Hope this makes sense.
I had that problem recently, but when I used apache's commons
fileupload class, I got it to work.
This page may help you.
http://jakarta.apache.org/commons/fileupload/using.html
- --
Corruptisima republica plurimae leges. [The more corrupt a republic, the
more laws.]
Tacitus from Annals III, 116AD
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (MingW32)
iD8DBQFDSI6LJ/zyYkX46joRAl83AJ4nmgA07+ymdRfbDbsrqRsoR3E2ngCfZYVD
9iX9/Z0s1+gfceD7xKDEWP0=
=O9S/
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org