Please refer servlet 3.0 specifications , section 188.8.131.52 asynchronous processing page 3. following is a paragraph from the above section
Dispatching from a servlet that has asyncSupported=true to one where
asyncSupported is set to false is allowed. In this case, the response will be
committed when the service method of the servlet that does not support async is
exited, and it is the container's responsibility to call complete on the
AsyncContext so that any interested AsyncListener instances will be notified.
The AsyncListener.onComplete notification should also be used by filters as a
mechanism to clear up resources that it has been holding on to for the async task to
my question is that suppose i have an asynchronous servlet that dispatches request to a jsp page. now suppose my long running process has completed and i called dispatch method and forwarded the request and response objects to the jsp page. now as the above paragraph says that response will be committed when the service method of the servlet that does not support async is exited(here jsp page will result in servlet). my question is that when will be AsyncContext.complete will be called ? before calling dispatch or after calling dispatch or after calling dispatch but before committing response or after committing response?