初始提交
diff --git a/tomcat-uidm/webapps/examples/jsp/chat/index.jsp b/tomcat-uidm/webapps/examples/jsp/chat/index.jsp
new file mode 100644
index 0000000..b7bc0d0
--- /dev/null
+++ b/tomcat-uidm/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-uidm/webapps/examples/jsp/chat/index.jsp.html b/tomcat-uidm/webapps/examples/jsp/chat/index.jsp.html
new file mode 100644
index 0000000..0b98ebf
--- /dev/null
+++ b/tomcat-uidm/webapps/examples/jsp/chat/index.jsp.html
@@ -0,0 +1,34 @@
+<html><body><pre>
+<%@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>
+</pre></body></html>
diff --git a/tomcat-uidm/webapps/examples/jsp/chat/login.jsp b/tomcat-uidm/webapps/examples/jsp/chat/login.jsp
new file mode 100644
index 0000000..e1c6496
--- /dev/null
+++ b/tomcat-uidm/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-uidm/webapps/examples/jsp/chat/login.jsp.html b/tomcat-uidm/webapps/examples/jsp/chat/login.jsp.html
new file mode 100644
index 0000000..d0fbe40
--- /dev/null
+++ b/tomcat-uidm/webapps/examples/jsp/chat/login.jsp.html
@@ -0,0 +1,35 @@
+<html><body><pre>
+<!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>
+</pre></body></html>
diff --git a/tomcat-uidm/webapps/examples/jsp/chat/post.jsp b/tomcat-uidm/webapps/examples/jsp/chat/post.jsp
new file mode 100644
index 0000000..cc8134d
--- /dev/null
+++ b/tomcat-uidm/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-uidm/webapps/examples/jsp/chat/post.jsp.html b/tomcat-uidm/webapps/examples/jsp/chat/post.jsp.html
new file mode 100644
index 0000000..90fa323
--- /dev/null
+++ b/tomcat-uidm/webapps/examples/jsp/chat/post.jsp.html
@@ -0,0 +1,57 @@
+<html><body><pre>
+<!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>
+</pre></body></html>