I don't need the file data in the second action.

Can I somehow recreate the request without the multipart file data, and pass
it forward to the second action?

I just saw a bug report on this
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25434 where Sharad says:
"All the request parameters are accessible in the new forward even for the
enc type "multipart/form-data", except for the FormFile value which is a
security limitation of HTML."

That is exactly what I would need, but it's not working :(



-----Original Message-----
From: Martin Cooper [mailto:[EMAIL PROTECTED]
Sent: Monday, 19 January 2004 18:51
To: [EMAIL PROTECTED]
Subject: Re: "multipart/form-data" causes request lost after forward



"Cadariu, Mihai" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
m...
> Hi guys,
>
> I have 2 actions that are chained.

That's your first mistake. Chaining actions is generally a very bad idea.
The scenario you are seeing is just one reason. There are many, many threads
on this in the archives.

>
> In the first action I handle an upload, then I forward to the second
action.
> Here (in the second action), my request is gone (i.e. it's all empty).

Yes, it is indeed gone. The input stream was parsed, and consumed, when the
first request was processed, so it is no longer available for use by the
second action. This is just the way servlets work - it's not a Struts thing.

>
> I noticed this happens only when I have "multipart/form-data" encoding
type.

Yep.

> Now, I need this encoding for uploading, but yet I can't execute my second
> action.
>
> Can anyone please advise on how to proceed? Any workarounds? Thoughts...

The "workaround" is to not chain actions in the first place. You'll only
give yourself grief (as you have discovered).

--
Martin Cooper


>
> Many thanks,
> Mihai
>
>
> -- 
> The contents of this e-mail are intended for the named addressee only. It
> contains information that may be confidential. Unless you are the named
> addressee or an authorized designee, you may not copy or use it, or
disclose
> it to anyone else. If you received it in error please notify us
immediately
> and then destroy it.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it. 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to