I posted a Patch to this Mailing List a few days ago, but nobody seems to be
interested in it. I got an Error in 1.1b even when i just forwarded a
Multipart-Request to a JSP-Page.It's a bug in the RequestProcessor
doForward() Method. There the MultipartRequestWrapper must be unwrapped to a
normal HttpServletRequest-Object. See the patch

----- Original Message -----
From: "rob" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 18, 2002 2:47 PM
Subject: multipart/form-data (bug?) or intended behavior?


> It's been this way since struts 1.0 (and likely prior to) but http
> requests carrying multipart/form-data posts result in an exception being
> thrown if forwarded through more than one action.
>
> (e.g request flow)
>
> 1 - submit multipart/form-data request (with at least one file input)
>      request is forwarded to ActionOne.
> 2 - ActionOne handles multipart data, writes a file to disk does
>      something with other parameters etc.  then forwards to ActionTwo.
> 3 - Exception is thrown.
>
> This occurs in the following versions I've tested 1.0.x, 1.1-b1.  Copies
> of the exceptions follow this post.
>
> Workaround, never forward to a second action, always forward to a .jsp
> which must be the end point for the request after the first action.
> (This kind of sucks).
>
> If this is a bug then consider it submitted, if it's designed this way
> then how about changing it?  (pretty please?)
>
> Thanks
>
> Rob
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
--- RequestProcessor.java.orig  Sun Apr 14 12:44:49 2002
+++ RequestProcessor.java       Sun Apr 14 12:42:41 2002
@@ -962,6 +962,11 @@
                              HttpServletResponse response)
         throws IOException, ServletException
     {
+        //unwrap the multipart request if there is one
+        if (request instanceof MultipartRequestWrapper) {
+            request = ((MultipartRequestWrapper) request).getRequest();
+        }
+
         RequestDispatcher rd = getServletContext().getRequestDispatcher(uri);
         if (rd == null) {
             response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,

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

Reply via email to