You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by David Wall <d....@computer.org> on 2006/04/05 02:31:46 UTC

Form params from the request command line?

When using a regular request object, the calls to 
request.getParameterValues() will return FORM parameters set by <input> 
tags as well as parameters on the URL query string.

Does this happen with FileUpload?  It seems that it does not process 
params passed on the URL, only those input fields within the form.

Thanks,
David

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


Re: Form params from the request command line?

Posted by Martin Cooper <ma...@apache.org>.
On 4/4/06, David Wall <d....@computer.org> wrote:
>
> When using a regular request object, the calls to
> request.getParameterValues() will return FORM parameters set by <input>
> tags as well as parameters on the URL query string.
>
> Does this happen with FileUpload?  It seems that it does not process
> params passed on the URL, only those input fields within the form.


That is correct. FileUpload is processing the body of the request. If you
need access to parameters in the query string (why would you do this??), you
can use the usual methods.

--
Martin Cooper


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

Re: [fileupload] Form params from the request command line?

Posted by Sven Schliesing <sv...@schliesing.de>.
Sorry, it should have been "I know that this is _NOT_ a direct answer...".

Sven Schliesing wrote:
> Hi,
> 
> I know that this is a direct answer to your question, but why do you mix 
> GET-params to a POST-Request? I'm not pretty sure if this is even 
> supported in the HTTP 1.1-standard.
> Just use hidden fields and you will avoid this case.
> 
> Sven
> 
> 
> PS: please prefix your subject with [fileupload] next time, thanks
> 
> David Wall wrote:
>> When using a regular request object, the calls to 
>> request.getParameterValues() will return FORM parameters set by 
>> <input> tags as well as parameters on the URL query string.
>>
>> Does this happen with FileUpload?  It seems that it does not process 
>> params passed on the URL, only those input fields within the form.
>>
>> Thanks,
>> David
>>
>> ---------------------------------------------------------------------
>> 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


Re: [fileupload] Form params from the request command line?

Posted by Martin Cooper <ma...@apache.org>.
On 4/4/06, Craig McClanahan <cr...@apache.org> wrote:
>
> On 4/4/06, Martin Cooper <ma...@apache.org> wrote:
> >
> > On 4/4/06, Craig McClanahan <cr...@apache.org> wrote:
> > >
> > > On 4/4/06, Christopher L Merrill <ch...@webperformance.com> wrote:
> > > >
> > > > Sven Schliesing wrote:
> > > > > I know that this is a direct answer to your question, but why do
> you
> > > mix
> > > > > GET-params to a POST-Request? I'm not pretty sure if this is even
> > > > > supported in the HTTP 1.1-standard.
> > > >
> > > > I am fairly certain there is no limitation against this usage in the
> > > HTTP
> > > > spec. If it's there, someone please point me to it...I'd like to see
> > it.
> > > >
> > > > We find this particular case used quite frequently by our
> > customers.  In
> > > > fact, I'm looking at one of those customer sites right now - and it
> > has
> > > a
> > > > mix of both in the login form.
> > >
> > >
> > > In the Java arena the Servlet spec has explicit provisions describing
> > how
> > > this scenario (combination of query parameters on the URL and post
> data
> > > parameters) is handled, and it's supported in a well-defined
> > manner.  See
> > > section SRV.4.1 of the servlet spec.
> >
> >
> > Well, yes and no. The spec does state how the combination should be
> > handled,
> > but it then goes on to state that POST data is only available if it's
> > application/x-www-form-urlencoded data. In fact, it is not possible to
> > implement the spec to the letter for other types of POST data unless the
> > container provides support for those other types. That's because there's
> > no
> > way (short of an explicitly configured servlet filter) for an external
> > component such as Commons FileUpload to combine the POST parameters and
> > the
> > query parameters and present that combination to the user via the
> servlet
> > API.
>
>
> Agreed that the current FileUpload implementation doesn't violate the
> servlet spec (which only deals with application/x-www-form-urlencoded),
> but
> it would sure be cool if we could have Commons FileUpload simulate that
> mix
> of query parameters from the URL and posted content from a
> multipart/form-data post so that applications would be able to not worry
> about the differences.  If it takes a filter and a request wrapper to do
> that, so be it.  For me, the fact that filters require Servlet 2.3 or
> later
> is not an issue (although it might be for others).


Yeah, I've actually got code in the wings that does that. It almost went
into FileUpload 1.1, but I just wasn't (and still am not) happy with the
configuration code, so I held it back. Most likely it will land up in
FileUpload 2.0, along with solutions for most of the outstanding enhancement
requests.

Technically, that's a bug in the spec, although I'll concede it's a minor
> > one. ;-) On the other hand, why the Servlet EG has never yet baked in
> > support for other types of POST content baffles me. Even a hook so that
> > content type handlers can register with the container (and thus be able
> to
> > follow the spec to the letter in this regard) would be a great leap
> > forward.
>
>
> The servlet spec lacks a whole *ton* of things that it really needs to
> address :-(.  I've got a half-completed blog entry on that topic that I
> hope
> to publish someday, now that I'm actually not flying on airplanes for two
> weeks in a row.  But after that, life gets crazy again, so no guarantees.


Yeah, I know it's hardly the most prominent. ;-) I'll look forward to
reading what you have to say about it, but I won't hold my breath. ;-)

--
Martin Cooper


--
> > Martin Cooper
>
>
> Craig
>
>

Re: [fileupload] Form params from the request command line?

Posted by Craig McClanahan <cr...@apache.org>.
On 4/4/06, Martin Cooper <ma...@apache.org> wrote:
>
> On 4/4/06, Craig McClanahan <cr...@apache.org> wrote:
> >
> > On 4/4/06, Christopher L Merrill <ch...@webperformance.com> wrote:
> > >
> > > Sven Schliesing wrote:
> > > > I know that this is a direct answer to your question, but why do you
> > mix
> > > > GET-params to a POST-Request? I'm not pretty sure if this is even
> > > > supported in the HTTP 1.1-standard.
> > >
> > > I am fairly certain there is no limitation against this usage in the
> > HTTP
> > > spec. If it's there, someone please point me to it...I'd like to see
> it.
> > >
> > > We find this particular case used quite frequently by our
> customers.  In
> > > fact, I'm looking at one of those customer sites right now - and it
> has
> > a
> > > mix of both in the login form.
> >
> >
> > In the Java arena the Servlet spec has explicit provisions describing
> how
> > this scenario (combination of query parameters on the URL and post data
> > parameters) is handled, and it's supported in a well-defined
> manner.  See
> > section SRV.4.1 of the servlet spec.
>
>
> Well, yes and no. The spec does state how the combination should be
> handled,
> but it then goes on to state that POST data is only available if it's
> application/x-www-form-urlencoded data. In fact, it is not possible to
> implement the spec to the letter for other types of POST data unless the
> container provides support for those other types. That's because there's
> no
> way (short of an explicitly configured servlet filter) for an external
> component such as Commons FileUpload to combine the POST parameters and
> the
> query parameters and present that combination to the user via the servlet
> API.


Agreed that the current FileUpload implementation doesn't violate the
servlet spec (which only deals with application/x-www-form-urlencoded), but
it would sure be cool if we could have Commons FileUpload simulate that mix
of query parameters from the URL and posted content from a
multipart/form-data post so that applications would be able to not worry
about the differences.  If it takes a filter and a request wrapper to do
that, so be it.  For me, the fact that filters require Servlet 2.3 or later
is not an issue (although it might be for others).

Technically, that's a bug in the spec, although I'll concede it's a minor
> one. ;-) On the other hand, why the Servlet EG has never yet baked in
> support for other types of POST content baffles me. Even a hook so that
> content type handlers can register with the container (and thus be able to
> follow the spec to the letter in this regard) would be a great leap
> forward.


The servlet spec lacks a whole *ton* of things that it really needs to
address :-(.  I've got a half-completed blog entry on that topic that I hope
to publish someday, now that I'm actually not flying on airplanes for two
weeks in a row.  But after that, life gets crazy again, so no guarantees.

--
> Martin Cooper


Craig

Re: [fileupload] Form params from the request command line?

Posted by Martin Cooper <ma...@apache.org>.
On 4/4/06, Craig McClanahan <cr...@apache.org> wrote:
>
> On 4/4/06, Christopher L Merrill <ch...@webperformance.com> wrote:
> >
> > Sven Schliesing wrote:
> > > I know that this is a direct answer to your question, but why do you
> mix
> > > GET-params to a POST-Request? I'm not pretty sure if this is even
> > > supported in the HTTP 1.1-standard.
> >
> > I am fairly certain there is no limitation against this usage in the
> HTTP
> > spec. If it's there, someone please point me to it...I'd like to see it.
> >
> > We find this particular case used quite frequently by our customers.  In
> > fact, I'm looking at one of those customer sites right now - and it has
> a
> > mix of both in the login form.
>
>
> In the Java arena the Servlet spec has explicit provisions describing how
> this scenario (combination of query parameters on the URL and post data
> parameters) is handled, and it's supported in a well-defined manner.  See
> section SRV.4.1 of the servlet spec.


Well, yes and no. The spec does state how the combination should be handled,
but it then goes on to state that POST data is only available if it's
application/x-www-form-urlencoded data. In fact, it is not possible to
implement the spec to the letter for other types of POST data unless the
container provides support for those other types. That's because there's no
way (short of an explicitly configured servlet filter) for an external
component such as Commons FileUpload to combine the POST parameters and the
query parameters and present that combination to the user via the servlet
API.

Technically, that's a bug in the spec, although I'll concede it's a minor
one. ;-) On the other hand, why the Servlet EG has never yet baked in
support for other types of POST content baffles me. Even a hook so that
content type handlers can register with the container (and thus be able to
follow the spec to the letter in this regard) would be a great leap forward.

--
Martin Cooper


The HTTP spec is silent on this issue, as it should be ... interpretation of
> URLs and content types is a layer above the HTTP protocol itself.
>
> Craig
>
>
> C
> >
> >
> > --
> > ------------------------------------------------------------------------
> -
> > Chris Merrill                           |  http://www.webperformance.com
> > Web Performance Inc.
> >
> > Website Load Testing and Stress Testing Software & Services
> > ------------------------------------------------------------------------
> -
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> >
>
>

Re: [fileupload] Form params from the request command line?

Posted by Craig McClanahan <cr...@apache.org>.
On 4/4/06, Christopher L Merrill <ch...@webperformance.com> wrote:
>
> Sven Schliesing wrote:
> > I know that this is a direct answer to your question, but why do you mix
> > GET-params to a POST-Request? I'm not pretty sure if this is even
> > supported in the HTTP 1.1-standard.
>
> I am fairly certain there is no limitation against this usage in the HTTP
> spec. If it's there, someone please point me to it...I'd like to see it.
>
> We find this particular case used quite frequently by our customers.  In
> fact, I'm looking at one of those customer sites right now - and it has a
> mix of both in the login form.


In the Java arena the Servlet spec has explicit provisions describing how
this scenario (combination of query parameters on the URL and post data
parameters) is handled, and it's supported in a well-defined manner.  See
section SRV.4.1 of the servlet spec.

The HTTP spec is silent on this issue, as it should be ... interpretation of
URLs and content types is a layer above the HTTP protocol itself.

Craig


C
>
>
> --
> ------------------------------------------------------------------------ -
> Chris Merrill                           |  http://www.webperformance.com
> Web Performance Inc.
>
> Website Load Testing and Stress Testing Software & Services
> ------------------------------------------------------------------------ -
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

Re: [fileupload] Form params from the request command line?

Posted by Christopher L Merrill <ch...@webperformance.com>.
Sven Schliesing wrote:
> I know that this is a direct answer to your question, but why do you mix 
> GET-params to a POST-Request? I'm not pretty sure if this is even 
> supported in the HTTP 1.1-standard.

I am fairly certain there is no limitation against this usage in the HTTP
spec. If it's there, someone please point me to it...I'd like to see it.

We find this particular case used quite frequently by our customers.  In
fact, I'm looking at one of those customer sites right now - and it has a
mix of both in the login form.

C


-- 
------------------------------------------------------------------------ -
Chris Merrill                           |  http://www.webperformance.com
Web Performance Inc.

Website Load Testing and Stress Testing Software & Services
------------------------------------------------------------------------ -

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


Re: [fileupload] Form params from the request command line?

Posted by Sven Schliesing <sv...@schliesing.de>.
Thanks to you both, Christopher and Dion. I think I have to talk to my 
fellow who told me this rumor. :)

Dion Gillard wrote:
> The 'query' part of the URL (prefixed by ?) is not specifically for the GET
> method.
> 
> A URL can contain a query, regardless of whether it is a GET or POST
> request.
> 
> See the rfc: http://www.w3.org/Protocols/rfc2616/rfc2616.txt

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


Re: [fileupload] Form params from the request command line?

Posted by Dion Gillard <di...@gmail.com>.
The 'query' part of the URL (prefixed by ?) is not specifically for the GET
method.

A URL can contain a query, regardless of whether it is a GET or POST
request.

See the rfc: http://www.w3.org/Protocols/rfc2616/rfc2616.txt

On 4/5/06, Sven Schliesing <sv...@schliesing.de> wrote:
>
> Hi,
>
> I know that this is a direct answer to your question, but why do you mix
> GET-params to a POST-Request? I'm not pretty sure if this is even
> supported in the HTTP 1.1-standard.
> Just use hidden fields and you will avoid this case.
>
> Sven
>
>
> PS: please prefix your subject with [fileupload] next time, thanks
>
> David Wall wrote:
> > When using a regular request object, the calls to
> > request.getParameterValues() will return FORM parameters set by <input>
> > tags as well as parameters on the URL query string.
> >
> > Does this happen with FileUpload?  It seems that it does not process
> > params passed on the URL, only those input fields within the form.
> >
> > Thanks,
> > David
> >
> > ---------------------------------------------------------------------
> > 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
>
>


--
http://www.multitask.com.au/people/dion/
Chuck Norris sleeps with a night light. Not because Chuck Norris is afraid
of the dark, but because the dark is afraid of Chuck Norris

Re: [fileupload] Form params from the request command line?

Posted by Sven Schliesing <sv...@schliesing.de>.
Hi,

I know that this is a direct answer to your question, but why do you mix 
GET-params to a POST-Request? I'm not pretty sure if this is even 
supported in the HTTP 1.1-standard.
Just use hidden fields and you will avoid this case.

Sven


PS: please prefix your subject with [fileupload] next time, thanks

David Wall wrote:
> When using a regular request object, the calls to 
> request.getParameterValues() will return FORM parameters set by <input> 
> tags as well as parameters on the URL query string.
> 
> Does this happen with FileUpload?  It seems that it does not process 
> params passed on the URL, only those input fields within the form.
> 
> Thanks,
> David
> 
> ---------------------------------------------------------------------
> 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