Hi,
I have a job running asynchronously which simulate an HTTP request to retrieve a resource exposed by the container.
final RequestDispatcher rd = servletContext.getRequestDispatcher(path.charAt(0) == '/' ? path : '/' + path);
rd.include(new HttpServletRequestWrapper(new MyHttpServletRequestAdapter()), new HttpServletResponseWrapper(myWrappedResponse));
This will works if I run my code in the same thread as the real HTTP request because undertow checks that this request is actually bound to a ThreadLocal. Also note that everything works fine on tomcat for instance.
What do you think? I think my approach is legal.
Bye