views:

105

answers:

1

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 concept of the currently serviced HttpRequest. Any guidance appreciated.

+4  A: 

Use can use request-scoped beans: 3.5.4. Request, session, and global session scopes

axtavt