@@ -0,0 +1,1751 @@
+/**%0A * %0A */%0Apackage jetty.async.test;%0A%0Aimport java.io.IOException;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport javax.servlet.AsyncContext;%0Aimport javax.servlet.ServletException;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A/**%0A * Issues an async write with contentlength != bytes writte before%0A * %0A * @author Christoph L%C3%A4ubrich%0A */%0Apublic class DispatchFromTimeoutServlet extends HttpServlet %7B%0A%0A    /**%0A     * %0A     */%0A    private static final String TIMEOUT_ATTRIBUTE = %22Timeout%22;%0A    private static final long   serialVersionUID  = 3431896464670815605L;%0A%0A    @Override%0A    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException %7B%0A        Object timeoutMarker = req.getAttribute(TIMEOUT_ATTRIBUTE);%0A        System.out.println(%22Request: %22 + req.getRequestURI() + %22 Timeout: %22 + timeoutMarker + %22 Thread: %22 + Thread.currentThread().getName());%0A        if (timeoutMarker == null) %7B%0A            final AsyncContext async = req.startAsync();%0A            async.setTimeout(TimeUnit.SECONDS.toMillis(5));%0A            async.addListener(new DebugAsyncListener() %7B%0A                @Override%0A                public void onTimeout(javax.servlet.AsyncEvent event) throws IOException %7B%0A                    System.out.println(%22Timeout occured in Listener @ Thread: %22 + Thread.currentThread().getName());%0A                    event.getAsyncContext().getRequest().setAttribute(TIMEOUT_ATTRIBUTE, true);%0A                    event.getAsyncContext().dispatch();%0A                %7D;%0A            %7D);%0A        %7D else %7B%0A            System.out.println(%22Timeout occured in Thread: %22 + Thread.currentThread().getName());%0A        %7D%0A    %7D%0A%7D%0A

Add Servlet for dispatch test