I tried following code, getting null all the time.

public static HttpSession getSession(){
return new ThreadLocal<HttpServletRequest>().get().getSession();
}


2010/1/9 Elias Mårtenson <[email protected]>

> On 9 Jan, 01:27, Prashant Gupta <[email protected]> wrote:
>
> > I am trying to implement my own user management system, for that I need
> some
> > way to make session id available to all classes independent of whether it
> > extends HttpServlet or not. I know there is some way to do that but I am
> not
> > able to find it. Any kind of help would be appreciated.
>
> One way to do it is to use a servlet filter to make the user
> information available through a ThreadLocal instance. That way you can
> have a single static method that returns the user wherever you are.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine-java%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>
>
>
--
You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to