升级Tomcat版本 apache-tomcat-7.0.77
diff --git a/tomcat-uidm/webapps/examples/servlets/chat/index.jsp b/tomcat-uidm/webapps/examples/servlets/chat/index.jsp
new file mode 100644
index 0000000..5a33fcd
--- /dev/null
+++ b/tomcat-uidm/webapps/examples/servlets/chat/index.jsp
@@ -0,0 +1,32 @@
+<%--

+ 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 contentType="text/html; charset=UTF-8" %>

+<% if (session.getAttribute("nickname") == null) {

+    response.sendRedirect("login.jsp");

+    return;

+}

+%>

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

+<html>

+<head>

+   <title>JSP Chat</title>

+</head>

+<frameset rows="1*,4*">

+  <frame name="post" src="post.jsp" scrolling="no" title="Post message">

+  <frame name="chat" src="chat" scrolling="yes" title="Chat">

+</frameset>

+</html>

diff --git a/tomcat-uidm/webapps/examples/servlets/chat/index.jsp.html b/tomcat-uidm/webapps/examples/servlets/chat/index.jsp.html
new file mode 100644
index 0000000..250c249
--- /dev/null
+++ b/tomcat-uidm/webapps/examples/servlets/chat/index.jsp.html
@@ -0,0 +1,34 @@
+<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 contentType="text/html; charset=UTF-8" %>

+&lt;% if (session.getAttribute("nickname") == null) {

+    response.sendRedirect("login.jsp");

+    return;

+}

+%>

+&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

+&lt;html>

+&lt;head>

+   &lt;title>JSP Chat&lt;/title>

+&lt;/head>

+&lt;frameset rows="1*,4*">

+  &lt;frame name="post" src="post.jsp" scrolling="no" title="Post message">

+  &lt;frame name="chat" src="chat" scrolling="yes" title="Chat">

+&lt;/frameset>

+&lt;/html>

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

diff --git a/tomcat-uidm/webapps/examples/servlets/chat/login.jsp b/tomcat-uidm/webapps/examples/servlets/chat/login.jsp
new file mode 100644
index 0000000..8578ac9
--- /dev/null
+++ b/tomcat-uidm/webapps/examples/servlets/chat/login.jsp
@@ -0,0 +1,33 @@
+<%--

+ 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.

+--%>

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

+<%@page contentType="text/html; charset=UTF-8" %>

+<html>

+<head>

+   <title>JSP Chat</title>

+</head>

+

+<body bgcolor="#FFFFFF">

+

+<form method="POST" action='chat' target="_top" name="loginForm">

+<input type="hidden" name="action" value="login">

+Nickname: <input type="text" name="nickname">

+<input type="submit">

+</form>

+

+</body>

+</html>

diff --git a/tomcat-uidm/webapps/examples/servlets/chat/login.jsp.html b/tomcat-uidm/webapps/examples/servlets/chat/login.jsp.html
new file mode 100644
index 0000000..699a939
--- /dev/null
+++ b/tomcat-uidm/webapps/examples/servlets/chat/login.jsp.html
@@ -0,0 +1,35 @@
+<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;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

+&lt;%@page contentType="text/html; charset=UTF-8" %>

+&lt;html>

+&lt;head>

+   &lt;title>JSP Chat&lt;/title>

+&lt;/head>

+

+&lt;body bgcolor="#FFFFFF">

+

+&lt;form method="POST" action='chat' target="_top" name="loginForm">

+&lt;input type="hidden" name="action" value="login">

+Nickname: &lt;input type="text" name="nickname">

+&lt;input type="submit">

+&lt;/form>

+

+&lt;/body>

+&lt;/html>

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

diff --git a/tomcat-uidm/webapps/examples/servlets/chat/post.jsp b/tomcat-uidm/webapps/examples/servlets/chat/post.jsp
new file mode 100644
index 0000000..91fee7b
--- /dev/null
+++ b/tomcat-uidm/webapps/examples/servlets/chat/post.jsp
@@ -0,0 +1,55 @@
+<%--

+ 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.

+--%>

+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

+<%@page contentType="text/html; charset=UTF-8" %>

+<html>

+<head>

+   <title>JSP Chat</title>

+</head>

+

+<body bgcolor="#FFFFFF">

+

+<form method="POST" action='chat' name="postForm">

+<input type="hidden" name="action" value="post">

+Message: <input type="text" name="message">

+<input type="submit">

+</form>

+

+<br>

+<%

+  String serverName = request.getServerName();

+  if ("localhost".equals(serverName)) {

+      serverName = "127.0.0.1";

+  } else if ("127.0.0.1".equals(serverName)) {

+      serverName = "localhost";

+  }

+

+  String chatUrl = request.getScheme() + "://" + serverName + ":"

+    + request.getServerPort() + request.getContextPath()

+    + request.getServletPath();

+

+  // strip "post.jsp" from the address

+  chatUrl = chatUrl.substring(0, chatUrl.lastIndexOf("/") + 1);

+%>

+<a target="_blank" href="<%=chatUrl %>">Click to open a new chat window</a>

+<em>Note</em>: To avoid hitting the limit on the count of simultaneous

+connections to the same host, imposed by the

+<a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.4">HTTP specification</a>,

+the second chat window should be opened using a different URL, e.g. with

+an IP address instead of the host name.

+</body>

+</html>

diff --git a/tomcat-uidm/webapps/examples/servlets/chat/post.jsp.html b/tomcat-uidm/webapps/examples/servlets/chat/post.jsp.html
new file mode 100644
index 0000000..2ccfcbc
--- /dev/null
+++ b/tomcat-uidm/webapps/examples/servlets/chat/post.jsp.html
@@ -0,0 +1,57 @@
+<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;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

+&lt;%@page contentType="text/html; charset=UTF-8" %>

+&lt;html>

+&lt;head>

+   &lt;title>JSP Chat&lt;/title>

+&lt;/head>

+

+&lt;body bgcolor="#FFFFFF">

+

+&lt;form method="POST" action='chat' name="postForm">

+&lt;input type="hidden" name="action" value="post">

+Message: &lt;input type="text" name="message">

+&lt;input type="submit">

+&lt;/form>

+

+&lt;br>

+&lt;%

+  String serverName = request.getServerName();

+  if ("localhost".equals(serverName)) {

+      serverName = "127.0.0.1";

+  } else if ("127.0.0.1".equals(serverName)) {

+      serverName = "localhost";

+  }

+

+  String chatUrl = request.getScheme() + "://" + serverName + ":"

+    + request.getServerPort() + request.getContextPath()

+    + request.getServletPath();

+

+  // strip "post.jsp" from the address

+  chatUrl = chatUrl.substring(0, chatUrl.lastIndexOf("/") + 1);

+%>

+&lt;a target="_blank" href="&lt;%=chatUrl %>">Click to open a new chat window&lt;/a>

+&lt;em>Note&lt;/em>: To avoid hitting the limit on the count of simultaneous

+connections to the same host, imposed by the

+&lt;a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.1.4">HTTP specification&lt;/a>,

+the second chat window should be opened using a different URL, e.g. with

+an IP address instead of the host name.

+&lt;/body>

+&lt;/html>

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

diff --git a/tomcat-uidm/webapps/examples/servlets/cookies.html b/tomcat-uidm/webapps/examples/servlets/cookies.html
index 659a26d..91ee584 100644
--- a/tomcat-uidm/webapps/examples/servlets/cookies.html
+++ b/tomcat-uidm/webapps/examples/servlets/cookies.html
@@ -24,7 +24,7 @@
 <p><font color="#0000FF"><a href="servlet/CookieExample"><img src="images/execute.gif" align="right" border="0"></a><a href="index.html"><img src="images/return.gif" width="24" height="24" align="right" border="0"></a></font></p>

 <h3>Source Code for Cookie Example<font color="#0000FF"><br>

   </font> </h3>

-<font color="#0000FF"></font> 

+<font color="#0000FF"></font>

 <pre><font color="#0000FF">import</font> java.io.*;

 <font color="#0000FF">import</font> javax.servlet.*;

 <font color="#0000FF">import</font> javax.servlet.http.*;

@@ -36,7 +36,7 @@
     {

         response.setContentType(&quot;<font color="#009900">text/html</font>&quot;);

         PrintWriter out = response.getWriter();

-        

+

         <font color="#CC0000">// print out cookies</font>

 

         Cookie[] cookies = request.getCookies();

diff --git a/tomcat-uidm/webapps/examples/servlets/index.html b/tomcat-uidm/webapps/examples/servlets/index.html
index b778706..89fbbbe 100644
--- a/tomcat-uidm/webapps/examples/servlets/index.html
+++ b/tomcat-uidm/webapps/examples/servlets/index.html
@@ -116,6 +116,65 @@
 <p>Note: The source code for these examples does not contain all of the

 source code that is actually in the example, only the important sections

 of code. Code not important to understand the example has been removed

-for clarity.

+for clarity.</p>

+

+<b><u><font size="+1">Other Examples</font></u></b><br>

+<table BORDER=0 CELLSPACING=5 WIDTH="85%" >

+

+<tr>

+  <td colspan="3">Servlet 3.0 Asynchronous processing examples:</td>

+</tr>

+<tr VALIGN=TOP>

+  <td>async0&nbsp;</td>

+  <td VALIGN=TOP WIDTH="30%">

+    <a href="../async/async0"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP> Execute</a>

+  </td>

+  <td WIDTH="30%"></td>

+</tr>

+<tr VALIGN=TOP>

+  <td>async1&nbsp;</td>

+  <td VALIGN=TOP WIDTH="30%">

+    <a href="../async/async1"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP> Execute</a>

+  </td>

+  <td WIDTH="30%"></td>

+</tr>

+<tr VALIGN=TOP>

+  <td>async2&nbsp;</td>

+  <td VALIGN=TOP WIDTH="30%">

+    <a href="../async/async2"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP> Execute</a>

+  </td>

+  <td WIDTH="30%"></td>

+</tr>

+<tr VALIGN=TOP>

+  <td>async3&nbsp;</td>

+  <td VALIGN=TOP WIDTH="30%">

+    <a href="../async/async3"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP> Execute</a>

+  </td>

+  <td WIDTH="30%"></td>

+</tr>

+<tr VALIGN=TOP>

+  <td>stockticker&nbsp;</td>

+  <td VALIGN=TOP WIDTH="30%">

+    <a href="../async/stockticker"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP> Execute</a>

+  </td>

+  <td WIDTH="30%"></td>

+</tr>

+

+<tr>

+  <td colspan="3">Comet processing example:<br />

+    See the <strong>"Advanced IO"</strong> chapter in the User Guide for

+    details. This example only works with the HTTP NIO or HTTP APR/native

+    connectors as these are the only connectors that support Comet.</td>

+</tr>

+<tr VALIGN=TOP>

+  <td>Comet Chat&nbsp;</td>

+  <td VALIGN=TOP WIDTH="30%">

+    <a href="chat/"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP> Execute</a>

+  </td>

+  <td WIDTH="30%"></td>

+</tr>

+

+</table>

+

 </body>

 </html>

diff --git a/tomcat-uidm/webapps/examples/servlets/reqinfo.html b/tomcat-uidm/webapps/examples/servlets/reqinfo.html
index 4ac664b..97a54ce 100644
--- a/tomcat-uidm/webapps/examples/servlets/reqinfo.html
+++ b/tomcat-uidm/webapps/examples/servlets/reqinfo.html
@@ -24,7 +24,7 @@
 <p><font color="#0000FF"><a href="servlet/RequestInfoExample"><img src="images/execute.gif" align="right" border="0"></a><a href="index.html"><img src="images/return.gif" width="24" height="24" align="right" border="0"></a></font></p>

 <h3>Source Code for Request Info Example<font color="#0000FF"><br>

   </font> </h3>

-<font color="#0000FF"></font> 

+<font color="#0000FF"></font>

 <pre><font color="#0000FF">import</font> java.io.*;

 <font color="#0000FF">import</font> javax.servlet.*;

 <font color="#0000FF">import</font> javax.servlet.http.*;

diff --git a/tomcat-uidm/webapps/examples/servlets/reqparams.html b/tomcat-uidm/webapps/examples/servlets/reqparams.html
index b0de031..42ec507 100644
--- a/tomcat-uidm/webapps/examples/servlets/reqparams.html
+++ b/tomcat-uidm/webapps/examples/servlets/reqparams.html
@@ -24,7 +24,7 @@
 <p><font color="#0000FF"><a href="servlet/RequestParamExample"><img src="images/execute.gif" align="right" border="0"></a><a href="index.html"><img src="images/return.gif" width="24" height="24" align="right" border="0"></a></font></p>

 <h3>Source Code for Request Parameter Example<font color="#0000FF"><br>

   </font> </h3>

-<font color="#0000FF"></font> 

+<font color="#0000FF"></font>

 <pre><font color="#0000FF">import</font> java.io.*;

 <font color="#0000FF">import</font> java.util.*;

 <font color="#0000FF">import</font> javax.servlet.*;

diff --git a/tomcat-uidm/webapps/examples/servlets/sessions.html b/tomcat-uidm/webapps/examples/servlets/sessions.html
index 65fc7fd..febef83 100644
--- a/tomcat-uidm/webapps/examples/servlets/sessions.html
+++ b/tomcat-uidm/webapps/examples/servlets/sessions.html
@@ -24,7 +24,7 @@
 <p><font color="#0000FF"><a href="servlet/SessionExample"><img src="images/execute.gif" align="right" border="0"></a><a href="index.html"><img src="images/return.gif" width="24" height="24" align="right" border="0"></a></font></p>

 <h3>Source Code for Session Example<font color="#0000FF"><br>

   </font> </h3>

-<font color="#0000FF"></font> 

+<font color="#0000FF"></font>

 <pre><font color="#0000FF">import</font> java.io.*;

 <font color="#0000FF">import</font> java.util.*;

 <font color="#0000FF">import</font> javax.servlet.*;

@@ -37,7 +37,7 @@
     {

         response.setContentType(&quot;<font color="#009900">text/html</font>&quot;);

         PrintWriter out = response.getWriter();

-        

+

         HttpSession session = request.getSession(true);

 

         <font color="#CC0000">// print session info</font>