You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul McCulloch <pa...@axiossystems.com> on 2005/03/24 17:14:00 UTC

Reading parameters from a multipart request in a custom tag

I'm trying to access the request parameters (i.e. submitted form values) in
a custom tag. This is fine with 'normal' forms but with multipart forms
(enctype="multipart/form-data") this isn't working.

The code in the custom tag does, in essence, what the RequestProcessor does
- calls org.apache.commons.fileupload.FileUpload.parseRequest().

I believe that the problem is that it is not possible to read the request's
input stream more than once. The RequestProcessor reads the request's input
stream (and puts the parameters in the wrapped request object), so it
appears to not be available for me to read in the custom tag. The Struts
wrapped request is not available (AFAIK) to me in my custom tag.

I was wondering if anyone could confirm my analysis and/or suggest a
solution. 

The workaround I am currently using is to put the request parameters in a
request scoped attribute, in my Action. However this approach couples
together my Struts application with the open source custom tag - not a real
solution.

TIA,

Paul

Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message.
 
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code.  You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused.


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