On Wed, 09 Jul 2014 07:23 Martin Grigorov wrote:
> > ...
> > try {
> > response = (HttpServletResponse)asyncContext;
> >
>
> Maybe it is implementation detail that this cast works but usually you
have
> to use
>
http://docs.oracle.com/javaee/6/api/javax/servlet/AsyncContext.html#getResponse()
> to get the response
This was one of the things I was wondering about: calling
AsyncContext#getResponse() returns a ServletResponse instance that doesn't
implement the HTTP protocol specific sendError etc. methods.
What would be the correct way to return an error response (including HTTP
status code) to the client in this case?
marko