You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Upayavira <uv...@upaya.co.uk> on 2003/09/03 14:42:29 UTC

HTMLGenerator hardwired to HTTP

I have been aware for some time that the HTMLGenerator doesn't work 
within the CLI. Looking at the code, right at the beginning of the setup 
method it says:  

        HttpServletRequest request = (HttpServletRequest) 
objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT);

Now a regular component should not be gaining direct access to the 
HttpServletRequest, it should use the environment's request object. By 
making direct access to the HttpServletRequest, it breaks all 
environments other than HTTP, particularly the CLI.

Does anyone know why this dependency? Anyone able to remove it?

Regards, Upayavira



RE: HTMLGenerator hardwired to HTTP

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Hi,

I "reduced" the dependency to the http environment now. It's only
required now if the html generator is used like the stream
generator. If you specify a src it should work in CLI again.

I don't know who put that it, but I could remove it :)

Carsten

> -----Original Message-----
> From: Upayavira [mailto:uv@upaya.co.uk]
> Sent: Wednesday, September 03, 2003 2:42 PM
> To: dev@cocoon.apache.org
> Subject: HTMLGenerator hardwired to HTTP
> 
> 
> I have been aware for some time that the HTMLGenerator doesn't work 
> within the CLI. Looking at the code, right at the beginning of the setup 
> method it says:  
> 
>         HttpServletRequest request = (HttpServletRequest) 
> objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT);
> 
> Now a regular component should not be gaining direct access to the 
> HttpServletRequest, it should use the environment's request object. By 
> making direct access to the HttpServletRequest, it breaks all 
> environments other than HTTP, particularly the CLI.
> 
> Does anyone know why this dependency? Anyone able to remove it?
> 
> Regards, Upayavira
> 
>