jsr369-experts@servlet-spec.java.net

[jsr369-experts] Re: [servlet-spec users] Re: Behaviour of AsyncContext.dispatch()

From: Greg Wilkins <gregw_at_intalio.com>
Date: Fri, 13 Feb 2015 09:42:11 +1100

On 12 February 2015 at 23:45, Mark Thomas <markt_at_apache.org> wrote:

> > If the asynchronous cycle was started with
> > ServletRequest.startAsync(ServletRequest,ServletResponse) then the
> > dispatch is to the URI of the last dispatch prior to the startAsync of
> > type REQUEST, ASYNC or FORWARD. Otherwise the dispatch is to the URI
> > of the last dispatch prior to the startAsync of type REQUEST or ASYNC.
> >
> > Using the precise DispatcherType should avoid any confusion.
>
> s/URI/concatenation of the ServletPath and PathInfo/ plus address
> SERVLET_SPEC-18 and I'm sold.


Happy to avoid URI, but servletPAth + pathInfo is not strictly correct,
because it can also be do a different context path as a forward can cross
contexts. How about avoiding it all together:

If the asynchronous cycle was started with
ServletRequest.startAsync(ServletRequest,ServletResponse) then the dispatch
is to the resource that was the target of the last dispatch of type
REQUEST, ASYNC or FORWARD prior to the call of startAsync. Otherwise the
dispatch is to the resource that was the target of the last dispatch of
type REQUEST or ASYNC prior to the call to startAsync.


cheers



-- 
Greg Wilkins <gregw_at_intalio.com>  @  Webtide - *an Intalio subsidiary*
http://eclipse.org/jetty HTTP, SPDY, Websocket server and client that scales
http://www.webtide.com  advice and support for jetty and cometd.