jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nils Weinander <nils.weinan...@mogul.com>
Subject Re: Jackrabbut authentication, from another angle
Date Mon, 22 Mar 2010 15:18:44 GMT

On 2010-03-22 14:48, Justin Edelson [via Jackrabbit] wrote:
> Nils-
> Save the current servlet request in a ThreadLoad. It's something no one
> likes to do, but sometimes you have to do it.
>
> See
> http://kenai.com/projects/boxspring/sources/modules-svn/show/trunk/boxspring-http-objects-holder/src/main/java/com/mtvnet/boxspring/httpobjects?rev=260if
> you need an example of this. (note - this code is slightly more
> elaborate
> than you need - it allows for the current request and response to be
> available as Spring beans, which you don't need). The filter is in a
> subpackage for what I'm sure was a good reason at the time but cannot
> remember :)

Thanks Justin!

I have used a ThreadLocal like that before (to save the
request path for use away from the actual servlet class).
That should work. I may still have to go for this, but I
have finally managed to get hold of the servlet request
through Spring:

By registering

<listener>
    <listener-class>
org.springframework.web.context.request.RequestContextListener
    </listener-class>
</listener>

in web.xml and using ((ServletRequestAttributes) 
RequestContextHolder.getRequestAttributes()).getRequest(),
I can get the request and thus the user name logged in to
the container. I have used this to create an incredibly
naive and incomplete LoginModule, which fills the needs
at the moment.

-- 
mogul | nils weinander |
hudiksvallsgatan 4 113 30 stockholm sweden |
+46 8 4100 6456 | +46 709 78 28 37 |
nils.weinander@mogul.com | skype: nils.weinander |
www.mogul.com


-----
____________________________________________________________
Nils Weinander
-- 
View this message in context: http://n4.nabble.com/Jackrabbut-authentication-from-another-angle-tp1599551p1677770.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message