On 15/05/2013 20:35, Rossen Stoyanchev wrote:
> Mark,
> 
> While there is no response on the Servlet spec list, I have some follow-up
> questions:
> 
>> If you call complete() you'll end up with an IllegalStateException when
>> the error handler kicks in. You have to use dispatch(). The error handle
>> kicks in as soon as the dispatch() tries to write to the response.
> 
> Do you mean dispatch() + write to the response from within the dispatched
> thread thereby causing an error? I actually have no reason to write to the
> response at that point. I'm just trying to complete the async request and
> release any associated Servlet container resources.

Yes, the target of the dispatch() has to try and write something so the
error handler kicks in.

> I did try dispatch() and then complete() from within the dispatched thread.
> It leads to a similar ISE from AsyncStateMachine.

You shouldn't need to call complete(). Just try and write something and
let the container handle the resulting error.

> Lastly if I do call complete() without dispatch, thereby causing the ISE,
> does that actually complete the async request and release any container
> resources? I'm just trying to decide if this is something I can live with
> for now while the EG decides.

I haven't tested it but I don't believe it will. Something needs to
happen to get the request back on a container thread.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to