wood burning stoves*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes when is the AsyncContext.complete method called when dispatching request to the container ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "when is the AsyncContext.complete method called when dispatching request to the container ?" Watch "when is the AsyncContext.complete method called when dispatching request to the container ?" New topic
Author

when is the AsyncContext.complete method called when dispatching request to the container ?

gurpeet singh
Ranch Hand

Joined: Apr 04, 2012
Posts: 924
    
    1

Please refer servlet 3.0 specifications , section 2.3.3.3 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
complete.


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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: when is the AsyncContext.complete method called when dispatching request to the container ?
 
Similar Threads
How to send request data
sendRedirect not throwing IllegalStateException
AsyncContext timeout
help in asynchronous context
what do these lines means in servlet 3.0 specification ?