threadlocal variables in a servlet

前端 未结 5 1418
渐次进展
渐次进展 2020-12-15 13:04

Are the threadlocals variables global to all the requests made to the servlet that owns the variables?

I am using resin for the server.

Thanks for awnser.

5条回答
  •  北海茫月
    2020-12-15 13:32

    Using ThreadLocal to store request scoped information has the potential to break if you use Servlet 3.0 Suspendable requests (or Jetty Continuations) Using those API's multiple threads process a single request.

提交回复
热议问题