初始提交
diff --git a/tomcat-cas/webapps/examples/jsp/chat/index.jsp b/tomcat-cas/webapps/examples/jsp/chat/index.jsp
new file mode 100644
index 0000000..b7bc0d0
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/chat/index.jsp
@@ -0,0 +1,32 @@
+<%@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>

+<!--

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

+-->

+<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-cas/webapps/examples/jsp/chat/index.jsp.html b/tomcat-cas/webapps/examples/jsp/chat/index.jsp.html
new file mode 100644
index 0000000..0b98ebf
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/chat/index.jsp.html
@@ -0,0 +1,34 @@
+<html><body><pre>

+&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;!--

+ 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;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-cas/webapps/examples/jsp/chat/login.jsp b/tomcat-cas/webapps/examples/jsp/chat/login.jsp
new file mode 100644
index 0000000..e1c6496
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/chat/login.jsp
@@ -0,0 +1,33 @@
+<!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>

+<!--

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

+-->

+<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-cas/webapps/examples/jsp/chat/login.jsp.html b/tomcat-cas/webapps/examples/jsp/chat/login.jsp.html
new file mode 100644
index 0000000..d0fbe40
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/chat/login.jsp.html
@@ -0,0 +1,35 @@
+<html><body><pre>

+&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;!--

+ 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;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-cas/webapps/examples/jsp/chat/post.jsp b/tomcat-cas/webapps/examples/jsp/chat/post.jsp
new file mode 100644
index 0000000..cc8134d
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/chat/post.jsp
@@ -0,0 +1,55 @@
+<!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>

+<!--

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

+-->

+<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-cas/webapps/examples/jsp/chat/post.jsp.html b/tomcat-cas/webapps/examples/jsp/chat/post.jsp.html
new file mode 100644
index 0000000..90fa323
--- /dev/null
+++ b/tomcat-cas/webapps/examples/jsp/chat/post.jsp.html
@@ -0,0 +1,57 @@
+<html><body><pre>

+&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;!--

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