The difference is the region. In particular, the request variable is available only directly from the areas of doGet(..) , doPost(..) , etc. (Inside the methods). After the thread you are in displaces the method and enters your biz doSomething() method, etc., your code no longer has access to the request variable (scope changed), but getThreadLocal..() allows you to get access regardless of the method you are in, given that you are in the same thread as doGet() , etc.
source share