I'm using Jetty 7 continuations to implement some asynchronous processing. What I'm trying to do is start off the continuation (via .suspend()), and then hand the continuation off to some other object that will compose the response, which works fine. But Jetty keeps redispatching the response (with isInitial = false) to the servlet, and I don't want or need that, because the response is being dealt with by some other object.
So, I'd like to find a w开发者_如何学运维ay to explicitly not redispatch the request on timeout or expire, because I'm using an event-driven series of callbacks to actually produce the response.
See the documentation around continuation.isInitial()
- from http://wiki.eclipse.org/Jetty/Feature/Continuations:
Resuming a Request
Once an asynchronous event has occurred, the continuation can be resumed:
void myAsyncCallback(Object results) { continuation.setAttribute("results",results); continuation.resume(); }
When a continuation is resumed, the request is redispatched to the servlet container, almost as if the request had been received again. However during the redispatch, the
continuation.isInitial()
method returns false and any attributes set by the asynchronous handler are available.
精彩评论