Get AsyncContext from HttpServletRequest

。_饼干妹妹 提交于 2019-12-06 03:50:42

When I have done this in the past, we have done:

if (request.isAsyncSupported()) {
      AsyncContext asyncContext = request.startAsync();
      // Do whatever with context
}

The javadoc for getAsyncContext() does state: (in ServletRequest)

IllegalStateException - if this request has not been put into asynchronous mode, i.e., if neither startAsync() nor startAsync(ServletRequest,ServletResponse) has been called

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!