From: markt Date: Thu, 19 May 2011 08:55:43 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51229 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8d4394da00e4cb098fe129fbcb4959758fb85831;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51229 Fix bugs in the Servlet 3.0 asynchronous examples. Patch provided by Eiji Takahashi. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1124614 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 07494b903..576629bba 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -63,6 +63,10 @@ Add documentation for AJP-NIO connector. (markt/rjung) + + 51229: Fix bugs in the Servlet 3.0 asynchronous examples. + Patch provided by Eiji Takahashi. (markt) + diff --git a/webapps/examples/WEB-INF/classes/async/Async0.java b/webapps/examples/WEB-INF/classes/async/Async0.java index fabafe3d9..93dd0a0d4 100644 --- a/webapps/examples/WEB-INF/classes/async/Async0.java +++ b/webapps/examples/WEB-INF/classes/async/Async0.java @@ -37,9 +37,9 @@ public class Async0 extends HttpServlet { protected void service(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException { if (Boolean.TRUE == req.getAttribute("dispatch")) { log.info("Received dispatch, completing on the worker thread."); - req.getAsyncContext().complete(); log.info("After complete called started:"+req.isAsyncStarted()); resp.getWriter().write("Async dispatch worked:+"+System.currentTimeMillis()+"\n"); + req.getAsyncContext().complete(); } else { resp.setContentType("text/plain"); final AsyncContext actx = req.startAsync(); diff --git a/webapps/examples/jsp/async/index.jsp b/webapps/examples/jsp/async/index.jsp index 5f53107a8..7ab54aff8 100644 --- a/webapps/examples/jsp/async/index.jsp +++ b/webapps/examples/jsp/async/index.jsp @@ -65,5 +65,5 @@ Use cases: 7. Stock ticker - "> StockTicker + "> StockTicker \ No newline at end of file