ASF Bugzilla – Attachment 25667 Details for
Bug 49528
HttpServletRequest.isAsyncStarted() returns false when a Runnable is started
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Servlet 3.0 isAsyncStarted testcase
TestCase.java (text/x-java), 1.74 KB, created by
Pieter Libin
on 2010-06-30 06:32:11 UTC
(
hide
)
Description:
Servlet 3.0 isAsyncStarted testcase
Filename:
MIME Type:
Creator:
Pieter Libin
Created:
2010-06-30 06:32:11 UTC
Size:
1.74 KB
patch
obsolete
>/* > * Copyright (C) 2009 Emweb bvba, Leuven, Belgium. > * > * See the LICENSE file for terms of use. > */ >package eu.webtoolkit.jwt.examples.simplechat; > >import java.io.IOException; > >import javax.servlet.ServletException; >import javax.servlet.http.HttpServlet; >import javax.servlet.http.HttpServletRequest; >import javax.servlet.http.HttpServletResponse; > >public class TestCase extends HttpServlet { > private static final long serialVersionUID = 3008485606349707083L; > > @Override > protected void doGet(final HttpServletRequest request, HttpServletResponse response) > throws ServletException, IOException { > > System.err.println("Start async()"); > request.startAsync(); > System.err.println("Dispatching start()"); > System.err.println("request.isAsyncStarted()1" + request.isAsyncStarted()); > request.getAsyncContext().start(new Runnable() { > @Override > public void run() { > try { > System.err.println("request.isAsyncStarted()2" + request.isAsyncStarted()); > System.err.println("Before sleep()"); > Thread.sleep(4000); > System.err.println("After sleep()"); > System.err.println("request.isAsyncStarted()3" + request.isAsyncStarted()); > request.getAsyncContext().complete(); > System.err.println("Returning from run()"); > System.err.println("request.isAsyncStarted()4" + request.isAsyncStarted()); > } catch (InterruptedException e) { > // TODO Auto-generated catch block > e.printStackTrace(); > } > } > }); > System.err.println("Returning from doGet()"); > } > >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 49528
: 25667