ThreadLocal to store ServletRequest and Response in servlet: what for?

后端 未结 8 732
情歌与酒
情歌与酒 2020-12-05 21:19

Once I have came across a pattern, where ServletRequest and response objects are put to servlet\'s local ThreadLocal variables. The servlet class h

8条回答
  •  無奈伤痛
    2020-12-05 21:43

    I think the better case can be like..

    Connection object once created in Service layer put in ThreadLocal then call a DAO layer, get connection object from Threadlocal.

提交回复
热议问题