Hal,

I'm a little confused, being as I've never seen the components code.  First,
the request is only wrapped for multipart forms.  Second, by the time
processForward() is called, it is passed the original request, and not the
wrapped one.  What am I missing?

-----Original Message-----
From: Deadman, Hal [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 15, 2001 5:21 PM
To: [EMAIL PROTECTED]
Cc: 'Cedric Dumoulin'
Subject: RE: cvs commit: jakarta-struts/src/share/org/apache/struts/util
RequestUtils.java


What's the plan regarding forwarding the orignal request instead of the
wrapped request? Form submissions don't work in the current Struts build, at
least not on Weblogic 6.0. If ActionServlet is changed to unwrap the request
before fowarding, Cedric Dumoulin will need to change his Components code
because he has to copy the processForward() method in his class that
inherits from ActionServlet. But then his components framework will only
work with the latest struts builds....

Error from weblogic when it tries to dispatch to target using wrapped
request:
java.lang.ClassCastException:
org.apache.struts.upload.MultipartRequestWrapper at
weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
l.java:112) at
s1.struts.component.ActionComponentServlet.processForward(ActionComponentSer
vlet.java:198) at
s1.struts.component.ActionComponentServlet.processValidate(ActionComponentSe
rvlet.java:158) at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1553) at
com.tallan.odtos.web.servlet.AppActionServlet.process

Hal

> -----Original Message-----
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 11, 2001 7:28 PM
> To: [EMAIL PROTECTED]
> Subject: Re: cvs commit:
> jakarta-struts/src/share/org/apache/struts/util
> RequestUtils.java
>
>
>
>
> On Fri, 11 May 2001, Martin Cooper wrote:
>
> > At 03:44 PM 5/11/01, Craig R. McClanahan wrote:
> >
> >
> > >On 11 May 2001 [EMAIL PROTECTED] wrote:
> > >
> > > > mschachter    01/05/11 15:33:38
> > > >
> > > >   Modified:    src/share/org/apache/struts/action Action.java
> > > >                         ActionServlet.java
> > > >                src/share/org/apache/struts/upload
> > > >                         DiskMultipartRequestHandler.java
> > > >                src/share/org/apache/struts/util
> RequestUtils.java
> > > >   Added:       src/share/org/apache/struts/upload
> > > >                         MultipartRequestWrapper.java
> > > >   Log:
> > > >    - Added the MultipartRequestWrapper class, which is
> a class that
> > > implements
> > > >      HttpServletRequest and wraps a normal request.  All normal
> > > HttpServletRequest
> > > >      methods will be called to the underlying request,
> except for
> > > methods involving
> > > >      parameters, which were over-ridden to provide a
> transparent way of
> > > accessing
> > > >      multipart elements.  The version of the
> HttpServletRequest is
> > > Servlet 2.2, however
> > > >      the new methods from Servlet 2.3 are also included
> in this class
> > > with empty
> > > >      implementations so that Struts will build against
> the servlet 2.2
> > > and 2.3 jars
> > >
> > >One thing to remember in 2.2 is that you cannot pass your
> wrapped request
> > >object to a RequestDispatcher.forward() or
> RequestDispatcher.include()
> > >call.  In Tomcat 3.x, for example, you'd get a
> ClassCastException error if
> > >you tried to use this in an RD call.
> >
> > You mean if I have an Action that is invoked via POST with
> a file upload,
> > and I try to forward from there using
> mapping.findForward("nextAction"),
> > where the forward has redirect="false, this will fail? This
> would be very
> > bad - in every case where we have a file upload, we
> subsequently forward to
> > another action.
> >
>
> As long as you forward the *original* request object (and not the
> wrapper), you're fine.  I'm fighting some security fires on
> Tomcat so I
> haven't had time to look deeply into what Michael is
> changing, but wanted
> to raise the flag in case some assumptions about this were being made
> incorrectly.
>
> > >Craig
> >
> > --
> > Martin Cooper
> >
> >
> >
>
> Craig
>
>

Reply via email to