You're theory is correct. The input stream is consumed as it is parsed.

The process flow doesn't seem to match what I'm seeing (Struts 1.2.4). In
1.2.4 all off this is handled in the request processor - not the servlet.
The very first thing the request processor does (in processMultipart) is to
parse the input stream and put all of the request paramaters in the wrapped
request object.

You can access these with a simple request.getParamater() in
processPreprocess in your extended request processor.

There is still a problem with multipart requests in that the parameters are
never available in JSPs, as they get the original (rather than the wrapped)
request. I overcome this by coppying the paramaters into a request scoped
map.

Hope this is of some use.

Paul


> -----Original Message-----
> From: Carl Smith [mailto:[EMAIL PROTECTED]
> Sent: 28 July 2005 15:38
> To: user@struts.apache.org
> Subject: multipart request issues
> 
> 
> 
> I am having issues to get the request parameters from a 
> multipart request, le me explain my problem first:
> 
> Our flow of process is:
> 
> (1) a multipart request is submitted to a struts action 
> (let's say updateTableAction.do) using POST
> 
> (2) the multipart request is processed by 
> ActionServlet.process() method
> 
> (3) in our processPreprocess method, which overrides 
> processPreprocess in RequestProcessor.java from struts,
> 
> we need the parameters from this multipart request thus I am 
> doing this:
> 
> CommonsMultipartRequestHandler commonMultiPartHandler = new 
> CommonsMultipartRequestHandler(); 
> 
> 
> 
> try {
> 
> commonMultiPartHandler.handleRequest(request);
> 
> }catch(Exception e){
> 
> // some handling
> 
> }
> 
> Hashtable ht = commonMultiPartHandler.getTextElements(); // 
> thus I get the parameters from the request
> 
> (4) however, all the fields/parameters in multipart request 
> are no longer there in the updateTableAction.do
> 
> Can you help me find out why this is happening? One theory is 
> that a multipart request can't be parsed twice. Is this 
> correct, if it is correct, do you have any alternative?
> 
> Thanks.
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to