It would be helpful if we can expose the current SlingHttpServletRequest or
ResourceResolver via a threadlocal. 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.

Thoughts?

Chetan Mehrotra


On Mon, May 14, 2012 at 4:56 PM, Sarwar Bhuiyan <[email protected]>wrote:

> the resource will be different for every instance so annotation is not a
> good candidate to pass this anyway.  annotations would be used to wire up
> services when the services start on osgi bundle installation or update.
>
> Sarwar
>
> On Mon, May 14, 2012 at 12:00 PM, Davide <[email protected]> wrote:
>
> > On 14/05/2012 11:55, Sarwar Bhuiyan wrote:
> > > it's just called resource, not currentResource in JSPs.  In servlets,
> you
> > > get the resource from request.getResource or
> > > resourceResolver.getResource(path).  Not sure what you're asking in
> terms
> > > of @Reference.  Are you talking about when you are not in a servlet?
>  If
> > > you're using some java service or helper class, why not pass the
> resource
> > > object in the parameter?
> >
> > Yes, I'm in a java class. Normally I pass in the SlingHttpServletRequest
> > and it works. I was just wondering about any annotation we could use.
> >
> > thanks
> > Davide
> >
> >
>

Reply via email to