I have created a servlet 3.0 to explore asynchronous request processing:
@WebServlet(name=\"MyTest\", urlPatterns={\"/MyTest\"}, asyncSupported=true)
public
Please check if you have any request filter which is not enabled to support async. Either you can remove the filter (temporarily) or mark it to support async.
I checked out Tomcat's code and saw that the asyncSupported variable has to be explicitly set to true. That's why you are getting req.isAsyncSupported() == false
.
You could try to set the async attribute in the HttpServletRequest object to true by one of the following methods.
req.setAttribute("org.apache.catalina.ASYNC_SUPPORTED", true);
or
((org.apache.catalina.connector.Request)req).setAsyncSupported(true);
Hope it helps.