On Mon, May 14, 2012 at 2:55 PM, Chetan Mehrotra
<[email protected]> wrote:
> ...It would be helpful if we can expose the current SlingHttpServletRequest or
> ResourceResolver via a threadlocal...

aarghh ;-)

> ..This would simplify code where we need
> pass the request as method parameters . This can be done via a simple
> FIlter which publishes the request into a thread local and have a new API
> class which makes this request accessible....

This would work, but I would be against including such a filter in the
Sling codebase.

Passing the request to a method clearly indicates that you expect that
method to deal with it. It's a few more characters to type, but it
makes things clear.

IMHO, it's too easy to create a mess with threadlocals, which are just
another kind of global variables.

-Bertrand

Reply via email to