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