Hi,
How are we supposed to bind @RequestScoped variables in Jersey?
1. The scope @RequestScoped is listed in Jersey's "internal" package.
2. When I try to bindFactory().in(RequestScoped.class) I sometimes get
stale values out of ServiceLocator.getService(). Meaning, the
Factory binding is not getting removed at the end of the HTTP request.
3. Using ThreadLocal doesn't seem safe in light of the fact that
threads could be reused across HTTP requests, and there doesn't seem
to be a clean way to detect the end of a request.
Any ideas?
Thanks,
Gili