升级Tomcat版本 apache-tomcat-7.0.77
diff --git a/tomcat-uid/webapps/examples/jsp/async/async1.jsp b/tomcat-uid/webapps/examples/jsp/async/async1.jsp
new file mode 100644
index 0000000..fb6fa2d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/async/async1.jsp
@@ -0,0 +1,26 @@
+<%--

+ Licensed to the Apache Software Foundation (ASF) under one or more

+  contributor license agreements.  See the NOTICE file distributed with

+  this work for additional information regarding copyright ownership.

+  The ASF licenses this file to You under the Apache License, Version 2.0

+  (the "License"); you may not use this file except in compliance with

+  the License.  You may obtain a copy of the License at

+

+      http://www.apache.org/licenses/LICENSE-2.0

+

+  Unless required by applicable law or agreed to in writing, software

+  distributed under the License is distributed on an "AS IS" BASIS,

+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+  See the License for the specific language governing permissions and

+  limitations under the License.

+--%>

+<%@page session="false"%>

+Output from async1.jsp

+Type is <%=request.getDispatcherType()%>

+<%

+System.out.println("Inside Async 1");

+  if (request.isAsyncStarted()) {

+    request.getAsyncContext().complete();

+  }

+%>

+Completed async request at <%=new java.sql.Date(System.currentTimeMillis())%>
\ No newline at end of file
diff --git a/tomcat-uid/webapps/examples/jsp/async/async1.jsp.html b/tomcat-uid/webapps/examples/jsp/async/async1.jsp.html
new file mode 100644
index 0000000..4c460b8
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/async/async1.jsp.html
@@ -0,0 +1,28 @@
+<html><body><pre>

+&lt;%--

+ Licensed to the Apache Software Foundation (ASF) under one or more

+  contributor license agreements.  See the NOTICE file distributed with

+  this work for additional information regarding copyright ownership.

+  The ASF licenses this file to You under the Apache License, Version 2.0

+  (the "License"); you may not use this file except in compliance with

+  the License.  You may obtain a copy of the License at

+

+      http://www.apache.org/licenses/LICENSE-2.0

+

+  Unless required by applicable law or agreed to in writing, software

+  distributed under the License is distributed on an "AS IS" BASIS,

+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+  See the License for the specific language governing permissions and

+  limitations under the License.

+--%>

+&lt;%@page session="false"%>

+Output from async1.jsp

+Type is &lt;%=request.getDispatcherType()%>

+&lt;%

+System.out.println("Inside Async 1");

+  if (request.isAsyncStarted()) {

+    request.getAsyncContext().complete();

+  }

+%>

+Completed async request at &lt;%=new java.sql.Date(System.currentTimeMillis())%>

+</pre></body></html>

diff --git a/tomcat-uid/webapps/examples/jsp/async/async3.jsp b/tomcat-uid/webapps/examples/jsp/async/async3.jsp
new file mode 100644
index 0000000..c16d5d7
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/async/async3.jsp
@@ -0,0 +1,20 @@
+<%--

+ Licensed to the Apache Software Foundation (ASF) under one or more

+  contributor license agreements.  See the NOTICE file distributed with

+  this work for additional information regarding copyright ownership.

+  The ASF licenses this file to You under the Apache License, Version 2.0

+  (the "License"); you may not use this file except in compliance with

+  the License.  You may obtain a copy of the License at

+

+      http://www.apache.org/licenses/LICENSE-2.0

+

+  Unless required by applicable law or agreed to in writing, software

+  distributed under the License is distributed on an "AS IS" BASIS,

+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+  See the License for the specific language governing permissions and

+  limitations under the License.

+--%>

+<%@page session="false"%>

+Output from async3.jsp

+Type is <%=request.getDispatcherType()%>

+Completed async 3 request at <%=new java.sql.Date(System.currentTimeMillis())%>
\ No newline at end of file
diff --git a/tomcat-uid/webapps/examples/jsp/async/async3.jsp.html b/tomcat-uid/webapps/examples/jsp/async/async3.jsp.html
new file mode 100644
index 0000000..ad77ae9
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/async/async3.jsp.html
@@ -0,0 +1,22 @@
+<html><body><pre>

+&lt;%--

+ Licensed to the Apache Software Foundation (ASF) under one or more

+  contributor license agreements.  See the NOTICE file distributed with

+  this work for additional information regarding copyright ownership.

+  The ASF licenses this file to You under the Apache License, Version 2.0

+  (the "License"); you may not use this file except in compliance with

+  the License.  You may obtain a copy of the License at

+

+      http://www.apache.org/licenses/LICENSE-2.0

+

+  Unless required by applicable law or agreed to in writing, software

+  distributed under the License is distributed on an "AS IS" BASIS,

+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+  See the License for the specific language governing permissions and

+  limitations under the License.

+--%>

+&lt;%@page session="false"%>

+Output from async3.jsp

+Type is &lt;%=request.getDispatcherType()%>

+Completed async 3 request at &lt;%=new java.sql.Date(System.currentTimeMillis())%>

+</pre></body></html>

diff --git a/tomcat-uid/webapps/examples/jsp/async/index.jsp b/tomcat-uid/webapps/examples/jsp/async/index.jsp
new file mode 100644
index 0000000..28af9ac
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/async/index.jsp
@@ -0,0 +1,69 @@
+<%--

+ Licensed to the Apache Software Foundation (ASF) under one or more

+  contributor license agreements.  See the NOTICE file distributed with

+  this work for additional information regarding copyright ownership.

+  The ASF licenses this file to You under the Apache License, Version 2.0

+  (the "License"); you may not use this file except in compliance with

+  the License.  You may obtain a copy of the License at

+

+      http://www.apache.org/licenses/LICENSE-2.0

+

+  Unless required by applicable law or agreed to in writing, software

+  distributed under the License is distributed on an "AS IS" BASIS,

+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+  See the License for the specific language governing permissions and

+  limitations under the License.

+--%>

+<%@page session="false"%>

+

+<pre>

+Use cases:

+

+1. Simple dispatch

+ - servlet does startAsync()

+ - background thread calls ctx.dispatch()

+   <a href="<%=response.encodeURL("/examples/async/async0")%>"> Async 0 </a>

+

+2. Simple dispatch

+ - servlet does startAsync()

+ - background thread calls dispatch(/path/to/jsp)

+   <a href="<%=response.encodeURL("/examples/async/async1")%>"> Async 1 </a>

+

+3. Simple dispatch

+ - servlet does startAsync()

+ - background thread calls writes and calls complete()

+   <a href="<%=response.encodeURL("/examples/async/async2")%>"> Async 2 </a>

+

+4. Simple dispatch

+ - servlet does a startAsync()

+ - servlet calls dispatch(/path/to/jsp)

+ - servlet calls complete()

+   <a href="<%=response.encodeURL("/examples/async/async3")%>"> Async 3 </a>

+

+3. Timeout s1

+ - servlet does a startAsync()

+ - servlet does a setAsyncTimeout

+ - returns - waits for timeout to happen should return error page

+

+4. Timeout s2

+ - servlet does a startAsync()

+ - servlet does a setAsyncTimeout

+ - servlet does a addAsyncListener

+ - returns - waits for timeout to happen and listener invoked

+

+5. Dispatch to asyncSupported=false servlet

+ - servlet1 does a startAsync()

+ - servlet1 dispatches to dispatch(/servlet2)

+ - the container calls complete() after servlet2 is complete

+ - TODO

+

+6. Chained dispatch

+ - servlet1 does a startAsync

+ - servlet1 does a dispatch to servlet2 (asyncsupported=true)

+ - servlet2 does a dispatch to servlet3 (asyncsupported=true)

+ - servlet3 does a dispatch to servlet4 (asyncsupported=false)

+

+

+7. Stock ticker

+   <a href="<%=response.encodeURL("/examples/async/stockticker")%>"> StockTicker </a>

+</pre>
\ No newline at end of file
diff --git a/tomcat-uid/webapps/examples/jsp/async/index.jsp.html b/tomcat-uid/webapps/examples/jsp/async/index.jsp.html
new file mode 100644
index 0000000..6f124b5
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/async/index.jsp.html
@@ -0,0 +1,71 @@
+<html><body><pre>

+&lt;%--

+ Licensed to the Apache Software Foundation (ASF) under one or more

+  contributor license agreements.  See the NOTICE file distributed with

+  this work for additional information regarding copyright ownership.

+  The ASF licenses this file to You under the Apache License, Version 2.0

+  (the "License"); you may not use this file except in compliance with

+  the License.  You may obtain a copy of the License at

+

+      http://www.apache.org/licenses/LICENSE-2.0

+

+  Unless required by applicable law or agreed to in writing, software

+  distributed under the License is distributed on an "AS IS" BASIS,

+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

+  See the License for the specific language governing permissions and

+  limitations under the License.

+--%>

+&lt;%@page session="false"%>

+

+&lt;pre>

+Use cases:

+

+1. Simple dispatch

+ - servlet does startAsync()

+ - background thread calls ctx.dispatch()

+   &lt;a href="&lt;%=response.encodeURL("/examples/async/async0")%>"> Async 0 &lt;/a>

+

+2. Simple dispatch

+ - servlet does startAsync()

+ - background thread calls dispatch(/path/to/jsp)

+   &lt;a href="&lt;%=response.encodeURL("/examples/async/async1")%>"> Async 1 &lt;/a>

+

+3. Simple dispatch

+ - servlet does startAsync()

+ - background thread calls writes and calls complete()

+   &lt;a href="&lt;%=response.encodeURL("/examples/async/async2")%>"> Async 2 &lt;/a>

+

+4. Simple dispatch

+ - servlet does a startAsync()

+ - servlet calls dispatch(/path/to/jsp)

+ - servlet calls complete()

+   &lt;a href="&lt;%=response.encodeURL("/examples/async/async3")%>"> Async 3 &lt;/a>

+

+3. Timeout s1

+ - servlet does a startAsync()

+ - servlet does a setAsyncTimeout

+ - returns - waits for timeout to happen should return error page

+

+4. Timeout s2

+ - servlet does a startAsync()

+ - servlet does a setAsyncTimeout

+ - servlet does a addAsyncListener

+ - returns - waits for timeout to happen and listener invoked

+

+5. Dispatch to asyncSupported=false servlet

+ - servlet1 does a startAsync()

+ - servlet1 dispatches to dispatch(/servlet2)

+ - the container calls complete() after servlet2 is complete

+ - TODO

+

+6. Chained dispatch

+ - servlet1 does a startAsync

+ - servlet1 does a dispatch to servlet2 (asyncsupported=true)

+ - servlet2 does a dispatch to servlet3 (asyncsupported=true)

+ - servlet3 does a dispatch to servlet4 (asyncsupported=false)

+

+

+7. Stock ticker

+   &lt;a href="&lt;%=response.encodeURL("/examples/async/stockticker")%>"> StockTicker &lt;/a>

+&lt;/pre>

+</pre></body></html>