You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Peter Doyle <pe...@teomedia.com> on 2001/06/07 18:58:17 UTC

RE: SOLVED invalid multipart request in beta 3 Controller Wrapping Request

HAHA!

Right for anyone (not many) who came across this problem here is how to
solve it.

In the struts upload application you will see that control is sent to a JSP
after the uploading. If you send it to another action you get the
MultipartIterator problem. This is *I think* because the request is wrapped
in a MultipartRequest, as of beta 2. Now the action you forward to does not
expect the multipart request, I think, so it causes the exception... I guess
you could change the encrypt type of the destination action... anyway

What I did was forward control to a JSP that only contains a
<logic:redirect> to the action I want it to go to in the first place. As I'm
dumping everything into session anyway I don't need to worry about
replicating the request query.
The redirect jsp is rendered and control is redirected. You don't even know
its there.

The reason I don't use multipart in my original action is its not designed
to use multipart. I do the uploading in a separate form and action (that is
multipart) and then go back to the original action with the result, not to a
jsp.

Well it works for me :)

Peter


-----Original Message-----
From: Peter Doyle [mailto:peter@teomedia.com]
Sent: 07 June 2001 11:34
To: struts-user@jakarta.apache.org
Subject: RE: invalid multipart request in beta 3 Controller Wrapping
Request


Hi,
 I'm using IE 6 beta. I tired it with Netscape 6 and there was no change.
Its not a browser issue. The struts upload example works I think because the
forward is to a jsp and not to another action. In my case I forward to an
action that takes in the request from the controller. I guess the request is
Multipart but should be a regualar request....or the other way around.. Its
just confusing.

At least I'm not alone :)

Peter

-----Original Message-----
From: Graeme Miller [mailto:GraemeM@AdvantageGroup.co.nz]
Sent: 06 June 2001 23:17
To: 'struts-user@jakarta.apache.org'
Subject: RE: invalid multipart request in beta 3


Are you using IE 5.5?  Coz there are some documented issues with IE5 and
below and file uploads in Struts.

Unfortunately I AM using IE5.5 and this is not working for me in Struts
1.0b3 where it was in Struts 1.0b1 so something has definitely been broken
in either b2 or b3.

> -----Original Message-----
> From: Peter Doyle [mailto:peter@teomedia.com]
> Sent: Thursday, 7 June 2001 4:29 a.m.
> To: struts-user@jakarta.apache.org
> Subject: RE: invalid multipart request in beta 3
>
>
> The form tag uses enctype "multipart/form-data". Uploading is not the
> problem. The file uploads okay. When I forward to the next
> action I get the
> error. I'm wondering if the request is wrapped in a Mulitpart
> request of
> some kind.
>
> Peter
>
>
> -----Original Message-----
> From: Biswas Amalendu [mailto:abiswas_jakarta@hotmail.com]
> Sent: 06 June 2001 16:42
> To: struts-user@jakarta.apache.org
> Subject: Re: invalid multipart request in beta 3
>
>
> Hi Peter,
>
> I have a file upload program and I am using b3 and everything
> is working
> just fine. Would you make sure that you set the enctype to
> "multipart/form-data" on your form tag.
>
> Thanks,
> Amalendu Biswas.
>
>
> >From: "Peter Doyle" <pe...@teomedia.com>
> >Reply-To: struts-user@jakarta.apache.org
> >To: <st...@jakarta.apache.org>
> >Subject: invalid multipart request in beta 3
> >Date: Wed, 6 Jun 2001 15:44:58 +0100
> >
> >Hi,
> >  I recently changed from Struts b1 to b3. (I skipped b2) I have doe
> >working
> >with b1 to handle uploading, based on the upload application
> that came with
> >struts. Since changed to b3 I get the following error:
> >
> >javax.servlet.ServletException: MultipartIterator: invalid multipart
> >request
> >data, doesn't start with boundary
> >
> >I cannot find what has changed between struts b1 and b3 that
> would cause
> >this. I cannot find a way to resolve it. The code in my upload action
> >executes and finishes. Control is passed to the controller
> servlet where
> >this problem occurs.
> >
> >I would appreciate any help
> >
> >Thanks,
> >Peter
> >
> >
> >
> >javax.servlet.ServletException: MultipartIterator: invalid multipart
> >request
> >data, doesn't start with boundary
> >	at
> >org.apache.struts.upload.MultipartIterator.parseRequest(Multi
> partIterator.j
> a
> >va:345)
> >	at
> org.apache.struts.upload.MultipartIterator.(MultipartIterator.
> java:152)
> >	at
> >org.apache.struts.upload.DiskMultipartRequestHandler.handleRe
> quest(DiskMult
> i
> >partRequestHandler.java:65)
> >	at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:735)
> >	at
> >org.apache.struts.action.ActionServlet.processPopulate(Action
> Servlet.java:2
> 0
> >53)
> >	at
> org.apache.struts.action.ActionServlet.process(ActionServlet.j
> ava:1563)
> >	at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
> >	at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
> >	at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
> >	at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
> >	at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
> >	at
> >allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunReques
> tDispatcher.ja
> v
> >a:88)
> >	at
> >org.apache.struts.action.ActionServlet.processActionForward(A
> ctionServlet.j
> a
> >va:1758)
> >	at
> org.apache.struts.action.ActionServlet.process(ActionServlet.j
> ava:1595)
> >	at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
> >	at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
> >	at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
> >	at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
> >	at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
> >	at
> >allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunReques
> tDispatcher.ja
> v
> >a:88)
> >	at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
> >	at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
> >	at allaire.jrun.jrpp.ProxyEndpoint.run(ProxyEndpoint.java:354)
> >	at allaire.jrun.ThreadPool.run(ThreadPool.java:267)
> >	at allaire.jrun.WorkerThread.run(WorkerThread.java:74)
> >
> >
> >
> >
> >
> >--
> >__________________________________________________
> >Peter Doyle                      TEO Media Ireland
> >peter@teomedia.com         http://www.teomedia.com
> >Ph +353 1 888 1353              Fx +353 1 888 1354
> >Unit 8 Scotch Berth, North Wall, Dublin 1, Ireland
> >__________________________________________________
> >
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>