https://bz.apache.org/bugzilla/show_bug.cgi?id=66272

            Bug ID: 66272
           Summary: AsyncContextListener.onStartAsync is called before
                    listener can be set
           Product: Tomcat 9
           Version: 9.0.65
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: a701...@gmail.com
  Target Milestone: -----

There is currently no way to have the AsyncContextListener.onStartAsync
callback invoked. In order to set the AsyncContextListener on the AsyncContext
you need to have an instance of the AsyncContext. You can get it by calling
request.startAsync, this method immediately calls onStartAsync on the listener
before the listener could be set.

        AsyncContextListener listener = new AsyncContextListener();
        AsyncContext asyncContext = request.startAsync(); // calls onStartAsync
before listener could be set
        asyncContext.addListener(listener);

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to