cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giacomo Pati <pati_giac...@yahoo.com>
Subject Re: Bug in Environment?
Date Thu, 14 Sep 2000 14:35:08 GMT

--- Nicola Ken Barozzi <nicolaken@supereva.it> wrote:
> It seems there's a bug in the Enviornment subclasses.
> The HttpEnvironment class returns the outputStream
> directly, because of an error in its constructor:
>     /**
>      * Constructs a HttpEnvironment object from a HttpServletRequest
>      * and HttpServletResponse objects
>      */
>     public HttpEnvironment (String uri, HttpServletRequest request,
>                             HttpServletResponse response,
>                             ServletContext servletContext)
>     throws MalformedURLException, IOException {
>         super(uri, request.getParameter("cocoon-view"),
> servletContext.getRealPath("/"));
>         this.request = new HttpRequest (request, this);
>         this.servletRequest = request;
>         this.response = new HttpResponse (response);
>         this.servletResponse = response;
>         this.servletContext = servletContext;
> --        this.outputStream = response.getOutputStream();
> ++        this.outputStream = this.response.getOutputStream();
>         this.objectModel.put("request", this.request);
>         this.objectModel.put("response", this.response);
>         this.objectModel.put("context", this.servletContext);
>     }
> 
> Response is also a local variable in fact.

No, I think it's correct how it is.
AFAIR the ...environment.http.HttpResponse.getOutputStream will throw
an IllegalAccessException because nobody should be able to get the
OutputStream. Only the
...environment.http.HttpEnvironment.getOutputStream can deliver it and
this is reseved for the sitemap engine only (no sitemap components gets
access to the environment object).

Giacomo

=====
--
PWR GmbH, Organisation & Entwicklung      Tel:   +41 (0)1 856 2202
Giacomo Pati, CTO/CEO                     Fax:   +41 (0)1 856 2201
Hintereichenstrasse 7                     Mailto:Giacomo.Pati@pwr.ch
CH-8166 Niederweningen                    Web:   http://www.pwr.ch

__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

Mime
View raw message