blob: 28af9acd9a611114cc6dc38fb601858c1d9a2ef6 [file] [log] [blame]
刘洪青6266f992017-05-15 21:21:03 +08001<%--
2 Licensed to the Apache Software Foundation (ASF) under one or more
3 contributor license agreements. See the NOTICE file distributed with
4 this work for additional information regarding copyright ownership.
5 The ASF licenses this file to You under the Apache License, Version 2.0
6 (the "License"); you may not use this file except in compliance with
7 the License. You may obtain a copy of the License at
8
9 http://www.apache.org/licenses/LICENSE-2.0
10
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
16--%>
17<%@page session="false"%>
18
19<pre>
20Use cases:
21
221. Simple dispatch
23 - servlet does startAsync()
24 - background thread calls ctx.dispatch()
25 <a href="<%=response.encodeURL("/examples/async/async0")%>"> Async 0 </a>
26
272. Simple dispatch
28 - servlet does startAsync()
29 - background thread calls dispatch(/path/to/jsp)
30 <a href="<%=response.encodeURL("/examples/async/async1")%>"> Async 1 </a>
31
323. Simple dispatch
33 - servlet does startAsync()
34 - background thread calls writes and calls complete()
35 <a href="<%=response.encodeURL("/examples/async/async2")%>"> Async 2 </a>
36
374. Simple dispatch
38 - servlet does a startAsync()
39 - servlet calls dispatch(/path/to/jsp)
40 - servlet calls complete()
41 <a href="<%=response.encodeURL("/examples/async/async3")%>"> Async 3 </a>
42
433. Timeout s1
44 - servlet does a startAsync()
45 - servlet does a setAsyncTimeout
46 - returns - waits for timeout to happen should return error page
47
484. Timeout s2
49 - servlet does a startAsync()
50 - servlet does a setAsyncTimeout
51 - servlet does a addAsyncListener
52 - returns - waits for timeout to happen and listener invoked
53
545. Dispatch to asyncSupported=false servlet
55 - servlet1 does a startAsync()
56 - servlet1 dispatches to dispatch(/servlet2)
57 - the container calls complete() after servlet2 is complete
58 - TODO
59
606. Chained dispatch
61 - servlet1 does a startAsync
62 - servlet1 does a dispatch to servlet2 (asyncsupported=true)
63 - servlet2 does a dispatch to servlet3 (asyncsupported=true)
64 - servlet3 does a dispatch to servlet4 (asyncsupported=false)
65
66
677. Stock ticker
68 <a href="<%=response.encodeURL("/examples/async/stockticker")%>"> StockTicker </a>
69</pre>