Proper Alternative to ThreadLocalInvoker for Retrieving HttpServletRequest #5895
ananyaduvvuri
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We recently came across a scenario where our code is using ThreadLocalInvoker from the internal jersey-servlet package:
if (Proxy.isProxyClass(request.getClass())) {
@SuppressWarnings("unchecked")
ThreadLocalInvoker handle = (ThreadLocalInvoker) Proxy.getInvocationHandler(request);
actualRequest = handle.get();
}
However, since ThreadLocalInvoker is from an internal package, we want to refactor this to use a proper Jersey-supported approach.
Could someone please suggest the recommended way to retrieve the actual HttpServletRequest in this case? Any guidance or alternative solutions would be greatly appreciated.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions