Reputation: 180
How can I access, throughout a Spring application, the current thread scope...
In other words, how can I identify if the current thread scope is a request or a system local thread ?
Upvotes: 8
Views: 4705
Reputation: 10709
Try with
if (RequestContextHolder.getRequestAttributes() != null)
// request thread
Upvotes: 14