tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Tomcat 4.0 Beta3 and Request Attributes Error
Date Wed, 02 May 2001 23:18:17 GMT


On Wed, 2 May 2001, Remy Maucherat wrote:

> > On Wed, 2 May 2001, Ana wrote:
> >
> > > Hi,
> > > We think we have discovered an error. We call the include method of the
> > > RequestDispatcher from a servlet. Then,  we  call the setAttribute
> method
> > > of the request object  of the included JSP. If we call the getAttribute
> > > method of the request object in the servlet (after the include call),
> then
> > > there is not attribute.
> > >
> >
> > Yes, you definitely found an error.  The spec is silent on whether an
> > included servlet can modify the request attributes of the request it
> > receives, but it seems like an obviously useful thing that should be
> > possible.
> >
> > I just checked in a patch to fix it, which will show up in tonight's
> > nightly build (20010503).
> 
> Really ?
> According to the spec (#8.3), I was under the impression that the included
> servlet couldn't do anything but :
> - Write data to either the Writer or the OutputStream
> - Access (and I understood that as "read") the request object
> 
> So to be consistent with what is done with everything else, I wouldn't allow
> the modification.
> 
> Perhaps we should ask the question to Danny ;-)
> 

For those who don't know who Danny is, that is Danny Coward --
specification lead for the servlet spec.

I did ask.  He agreed that it's not spec'd but that it makes sense to give
the included servlet a sense that it is talking to the "same" request that
the calling servlet is, even though it's not technically true.  The only
change that the original servlet can make when it "accesses" the request
is to set or remove attributes, so an included servlet should be able to
as well.

> Remy
> 
> 

Craig




Mime
View raw message