Hi Guys!
I faced this code below in spring-social-quickstart example.
Can somebody explain me why we should use ThreadLocal to store User.
What is the real benefit to store here instead of member class variable where it is used up ?Code:public final class SecurityContext { private static final ThreadLocal<User> currentUser = new ThreadLocal<User>(); ...
Thanks in advance.
Cs.


Reply With Quote
i dont know the benefits of ThreadLocal. So i understand the reason, but what about the how to ?