commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Cook <bc...@printtime.com>
Subject Re: [FileUpload] Issue with multipart/form-data and request parameters in include
Date Fri, 26 Aug 2005 19:27:48 GMT

Is there a reason that the URL parameters can not be included as a 
hidden field in the form?  i.e. Instead of setting a form tag with the 
action set to "resource.jsp?param=value".  Set up your form to post the 
value with the form as a hidden form field set up


<form name="form" id="form" method="post" action="resource.jsp" 
enctype="multipart/form-data">

     .....

   <input type="hidden" name="param" value="value" />

     .....


</form>

This would be much easier and more reliable that trying to make 
commons.fileupload much more complicated.

If you have to do it the way you outlined then you might be able to pull 
that value out of the HttpHeader object.



Andreas Schildbach wrote:
> Hi everyone,
> 
> I've got an issue with FileUpload 1.0:
> 
> I've got a form that posts with enctype="multipart/form-data". The 
> Controller decodes the request using FileUpload and forwards to a JSP, 
> which includes another resource with a parameter 
> ("resource.jsp?param=value").
> 
> So, basically, there are form parameters in the body (encoded) AND there 
> are parameters in the URL as in a GET request.
> 
> Unfortunately, this "param" URL parameter is discarded, which is kind of 
> understandable, because FileUpload expects the parameters of the still 
> multipart/form-data request encoded in the request body.
> 
> However, with the default enctype for method="post" I can do that. I 
> don't know what the Servlet spec says on this topic. But could you maybe 
> also "map through" all parameters that are specified in the URL? 
> Basically, allow access to all parameters that are available in the 
> request, with body parameters taking precedence?
> 
> Regards,
> 
> Andreas
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 


-- 
Brian Cook
Digital Services Analyst
Print Time Inc.
bcook@printtime.com
913.345.8900


Mime
View raw message