cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicola Ken Barozzi" <>
Subject Bug in Environment?
Date Thu, 14 Sep 2000 14:04:59 GMT
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.


Nicola Ken Barozzi - AISA Industries S.p.A
Via Leonardo da Vinci,2 Ticengo (CR) Italy
Research Activity:
Politecnico di Milano - Dipartimento di Meccanica
Piazza Leonardo da Vinci, n.32 - 20133 Milano (Italy)

View raw message