cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Gianni <simo...@apache.org>
Subject Re: [RT] Accessing environment information in 2.2
Date Tue, 12 Dec 2006 16:28:42 GMT
Hi Carsten,
maybe I'm missing something, but isn't there a ProcessInfoProvider, with
which you can access request, response, servlet context and object model
(and from there all the rest)?

It ends in a thread local anyway, since uses the environment stack
Daniel told about.

If this is not the right class, then maybe we should revise the
javadocs, since the ContextHelper (which was used in 2.1 to access all
other stuff from a Contextualizable component) is deprecated and the
ProcessInfoProvider is suggested instead.

Simone

Carsten Ziegeler wrote:
> During development you sometimes face the problem that you need access
> to specific information, like the current request object (or its
> parameters), the Spring application context, the servlet context etc.
>
> In an ideal world where everything is a component, this is no issue as
> the container provides a way for this. But as we all know, the world is
> not ideal and this means, you sometimes need access to those objects
> when you don't have anything else to use.
>
> So, I think we need a way to provide those information. The best choice
> seems to be to use thread local variables.
> I think we need a way to access the servlet context, the original http
> request/response object and the current application context. (If you
> have access to the current request object, you can get the application
> context from the request).
>
> The provide access to those things from everywhere the best way is to
> have a general servlet filter putting the information into thread local
> variables and cleaning them after the request is finished.
>
> This approach has the drawback that users have to put this filter into
> their web.xml. So I think we should make this a little bit more user
> friendly and add the logic/code of this filter to all servlets we
> provide by default (which means the servlet performs the code). So as
> long as users are using our servlets, they get the information "for
> free". In addition, we provide the servlet filter for users who might
> want to use different servlets but need the same information.
>
> WDYT?
>   


Mime
View raw message