how to get a Spring bean that is local to the current HttpRequest
I would like to be able to create a bean whose scope is limited to the currently serviced HttpRequest.
I considered ThreadLocal
but the problem I see is that threads can be reused to service an HttpRequest by the container. I would like to use said bean in a bean that has no conce开发者_运维问答pt of the currently serviced HttpRequest. Any guidance appreciated.
Use can use request-scoped beans: 3.5.4. Request, session, and global session scopes
精彩评论