初始提交
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/CookieExample.class b/tomcat-uid/webapps/examples/WEB-INF/classes/CookieExample.class
new file mode 100644
index 0000000..bc8e321
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/CookieExample.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/CookieExample.java b/tomcat-uid/webapps/examples/WEB-INF/classes/CookieExample.java
new file mode 100644
index 0000000..5d7d5ce
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/CookieExample.java
@@ -0,0 +1,117 @@
+/*
+* 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.
+*/
+
+import java.io.*;
+import java.util.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import util.HTMLFilter;
+
+/**
+ * Example servlet showing request headers
+ *
+ * @author James Duncan Davidson <duncan@eng.sun.com>
+ */
+
+public class CookieExample extends HttpServlet {
+
+ ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
+
+ public void doGet(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ response.setContentType("text/html");
+
+ PrintWriter out = response.getWriter();
+ out.println("<html>");
+ out.println("<head>");
+
+ String title = rb.getString("cookies.title");
+ out.println("<title>" + title + "</title>");
+ out.println("</head>");
+ out.println("<body bgcolor=\"white\">");
+
+ // relative links
+
+ // XXX
+ // making these absolute till we work out the
+ // addition of a PathInfo issue
+
+ out.println("<a href=\"../cookies.html\">");
+ out.println("<img src=\"../images/code.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"view code\"></a>");
+ out.println("<a href=\"../index.html\">");
+ out.println("<img src=\"../images/return.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"return\"></a>");
+
+ out.println("<h3>" + title + "</h3>");
+
+ Cookie[] cookies = request.getCookies();
+ if ((cookies != null) && (cookies.length > 0)) {
+ out.println(rb.getString("cookies.cookies") + "<br>");
+ for (int i = 0; i < cookies.length; i++) {
+ Cookie cookie = cookies[i];
+ out.print("Cookie Name: " + HTMLFilter.filter(cookie.getName())
+ + "<br>");
+ out.println(" Cookie Value: "
+ + HTMLFilter.filter(cookie.getValue())
+ + "<br><br>");
+ }
+ } else {
+ out.println(rb.getString("cookies.no-cookies"));
+ }
+
+ String cookieName = request.getParameter("cookiename");
+ String cookieValue = request.getParameter("cookievalue");
+ if (cookieName != null && cookieValue != null) {
+ Cookie cookie = new Cookie(cookieName, cookieValue);
+ response.addCookie(cookie);
+ out.println("<P>");
+ out.println(rb.getString("cookies.set") + "<br>");
+ out.print(rb.getString("cookies.name") + " "
+ + HTMLFilter.filter(cookieName) + "<br>");
+ out.print(rb.getString("cookies.value") + " "
+ + HTMLFilter.filter(cookieValue));
+ }
+
+ out.println("<P>");
+ out.println(rb.getString("cookies.make-cookie") + "<br>");
+ out.print("<form action=\"");
+ out.println("CookieExample\" method=POST>");
+ out.print(rb.getString("cookies.name") + " ");
+ out.println("<input type=text length=20 name=cookiename><br>");
+ out.print(rb.getString("cookies.value") + " ");
+ out.println("<input type=text length=20 name=cookievalue><br>");
+ out.println("<input type=submit></form>");
+
+
+ out.println("</body>");
+ out.println("</html>");
+ }
+
+ public void doPost(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ doGet(request, response);
+ }
+
+}
+
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/HelloWorldExample.class b/tomcat-uid/webapps/examples/WEB-INF/classes/HelloWorldExample.class
new file mode 100644
index 0000000..0d3c85e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/HelloWorldExample.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/HelloWorldExample.java b/tomcat-uid/webapps/examples/WEB-INF/classes/HelloWorldExample.java
new file mode 100644
index 0000000..3702542
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/HelloWorldExample.java
@@ -0,0 +1,72 @@
+/*
+* 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.
+*/
+
+import java.io.*;
+import java.util.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+/**
+ * The simplest possible servlet.
+ *
+ * @author James Duncan Davidson
+ */
+
+public class HelloWorldExample extends HttpServlet {
+
+
+ public void doGet(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ ResourceBundle rb =
+ ResourceBundle.getBundle("LocalStrings",request.getLocale());
+ response.setContentType("text/html");
+ PrintWriter out = response.getWriter();
+
+ out.println("<html>");
+ out.println("<head>");
+
+ String title = rb.getString("helloworld.title");
+
+ out.println("<title>" + title + "</title>");
+ out.println("</head>");
+ out.println("<body bgcolor=\"white\">");
+
+ // note that all links are created to be relative. this
+ // ensures that we can move the web application that this
+ // servlet belongs to to a different place in the url
+ // tree and not have any harmful side effects.
+
+ // XXX
+ // making these absolute till we work out the
+ // addition of a PathInfo issue
+
+ out.println("<a href=\"../helloworld.html\">");
+ out.println("<img src=\"../images/code.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"view code\"></a>");
+ out.println("<a href=\"../index.html\">");
+ out.println("<img src=\"../images/return.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"return\"></a>");
+ out.println("<h1>" + title + "</h1>");
+ out.println("</body>");
+ out.println("</html>");
+ }
+}
+
+
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings.properties b/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings.properties
new file mode 100644
index 0000000..457b03e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings.properties
@@ -0,0 +1,51 @@
+# 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.
+
+# Default localized resources for example servlets
+# This locale is en_US
+
+helloworld.title=Hello World!
+
+requestinfo.title=Request Information Example
+requestinfo.label.method=Method:
+requestinfo.label.requesturi=Request URI:
+requestinfo.label.protocol=Protocol:
+requestinfo.label.pathinfo=Path Info:
+requestinfo.label.remoteaddr=Remote Address:
+
+requestheader.title=Request Header Example
+
+requestparams.title=Request Parameters Example
+requestparams.params-in-req=Parameters in this request:
+requestparams.no-params=No Parameters, Please enter some
+requestparams.firstname=First Name:
+requestparams.lastname=Last Name:
+
+cookies.title=Cookies Example
+cookies.cookies=Your browser is sending the following cookies:
+cookies.no-cookies=Your browser isn't sending any cookies
+cookies.make-cookie=Create a cookie to send to your browser
+cookies.name=Name:
+cookies.value=Value:
+cookies.set=You just sent the following cookie to your browser:
+
+sessions.title=Sessions Example
+sessions.id=Session ID:
+sessions.created=Created:
+sessions.lastaccessed=Last Accessed:
+sessions.data=The following data is in your session:
+sessions.adddata=Add data to your session
+sessions.dataname=Name of Session Attribute:
+sessions.datavalue=Value of Session Attribute:
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings_en.properties b/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings_en.properties
new file mode 100644
index 0000000..457b03e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings_en.properties
@@ -0,0 +1,51 @@
+# 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.
+
+# Default localized resources for example servlets
+# This locale is en_US
+
+helloworld.title=Hello World!
+
+requestinfo.title=Request Information Example
+requestinfo.label.method=Method:
+requestinfo.label.requesturi=Request URI:
+requestinfo.label.protocol=Protocol:
+requestinfo.label.pathinfo=Path Info:
+requestinfo.label.remoteaddr=Remote Address:
+
+requestheader.title=Request Header Example
+
+requestparams.title=Request Parameters Example
+requestparams.params-in-req=Parameters in this request:
+requestparams.no-params=No Parameters, Please enter some
+requestparams.firstname=First Name:
+requestparams.lastname=Last Name:
+
+cookies.title=Cookies Example
+cookies.cookies=Your browser is sending the following cookies:
+cookies.no-cookies=Your browser isn't sending any cookies
+cookies.make-cookie=Create a cookie to send to your browser
+cookies.name=Name:
+cookies.value=Value:
+cookies.set=You just sent the following cookie to your browser:
+
+sessions.title=Sessions Example
+sessions.id=Session ID:
+sessions.created=Created:
+sessions.lastaccessed=Last Accessed:
+sessions.data=The following data is in your session:
+sessions.adddata=Add data to your session
+sessions.dataname=Name of Session Attribute:
+sessions.datavalue=Value of Session Attribute:
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings_es.properties b/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings_es.properties
new file mode 100644
index 0000000..f5a1261
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings_es.properties
@@ -0,0 +1,51 @@
+# 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.
+
+# Default localized string information
+# Localized para Locale es_ES
+
+helloworld.title=Hola Mundo!
+
+requestinfo.title=Ejemplo de Informacion de Request
+requestinfo.label.method=Metodo:
+requestinfo.label.requesturi=Request URI:
+requestinfo.label.protocol=Protocolo:
+requestinfo.label.pathinfo=Path Info:
+requestinfo.label.remoteaddr=Direccion Remota:
+
+requestheader.title=Ejemplo de Cabecera de Request
+
+requestparams.title=Ejemplo de parametros de Request
+requestparams.params-in-req=Parametros en este Request:
+requestparams.no-params=No hay parametro. por favor usa alguno
+requestparams.firstname=Nombre:
+requestparams.lastname=Apellidos:
+
+cookies.title=Ejemplo de Cookies
+cookies.cookies=Tu navegador esta enviando los siguientes cookies:
+cookies.no-cookies=Tu navegador no esta enviando cookies
+cookies.make-cookie=Crea un cookie para enviarlo a tu navegador
+cookies.name=Nombre:
+cookies.value=Valor:
+cookies.set=Acabas de enviar a tu navegador estos cookies:
+
+sessions.title=ejemplo de Sesiones
+sessions.id=ID de Sesion:
+sessions.created=Creado:
+sessions.lastaccessed=Ultimo Acceso:
+sessions.data=Lo siguientes datos estan en tu sesion:
+sessions.adddata=A\u00f1ade datos a tu sesion:
+sessions.dataname=Nombre del atributo de sesion:
+sessions.datavalue=Valor del atributo de sesion:
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings_fr.properties b/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings_fr.properties
new file mode 100644
index 0000000..a66211e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings_fr.properties
@@ -0,0 +1,51 @@
+# 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.
+
+# Default localized resources for example servlets
+# This locale is fr_FR
+
+helloworld.title=Salut le Monde!
+
+requestinfo.title=Exemple d''information sur la requ\u00eate
+requestinfo.label.method=M\u00e9thode:
+requestinfo.label.requesturi=URI de requ\u00eate:
+requestinfo.label.protocol=Protocole:
+requestinfo.label.pathinfo=Info de chemin:
+requestinfo.label.remoteaddr=Adresse distante:
+
+requestheader.title=Exemple d''information sur les ent\u00eate de requ\u00eate
+
+requestparams.title=Exemple de requ\u00eate avec param\u00eatres
+requestparams.params-in-req=Param\u00eatres dans la requ\u00eate:
+requestparams.no-params=Pas de param\u00eatre, merci dans saisir quelqu'uns
+requestparams.firstname=Pr\u00e9nom:
+requestparams.lastname=Nom:
+
+cookies.title=Exemple d''utilisation de Cookies
+cookies.cookies=Votre navigateur retourne les cookies suivant:
+cookies.no-cookies=Votre navigateur ne retourne aucun cookie
+cookies.make-cookie=Cr\u00e9ation d''un cookie \u00e0 retourner \u00e0 votre navigateur
+cookies.name=Nom:
+cookies.value=Valeur:
+cookies.set=Vous venez d''envoyer le cookie suivant \u00e0 votre navigateur:
+
+sessions.title=Exemple de Sessions
+sessions.id=ID de Session:
+sessions.created=Cr\u00e9e le:
+sessions.lastaccessed=Dernier acc\u00e8s:
+sessions.data=Les donn\u00e9es existantes dans votre session:
+sessions.adddata=Ajouter des donn\u00e9es \u00e0 votre session
+sessions.dataname=Nom de l''Attribut de Session:
+sessions.datavalue=Valeur de l''Attribut de Session:
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings_pt.properties b/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings_pt.properties
new file mode 100644
index 0000000..b74813a
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/LocalStrings_pt.properties
@@ -0,0 +1,51 @@
+# 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.
+
+# Default localized resources for example servlets
+# This locale is pt_PT
+
+helloworld.title=Ola Mundo!
+
+requestinfo.title=Exemplo da Informacao do Pedido
+requestinfo.label.method=Metodo:
+requestinfo.label.requesturi=URI do Pedido:
+requestinfo.label.protocol=Protocolo:
+requestinfo.label.pathinfo=Informacao do Caminho:
+requestinfo.label.remoteaddr=Endereco Remoto:
+
+requestheader.title=Exemplo da Cebeceira do Pedido
+
+requestparams.title=Examplo de Parametros do Pedido
+requestparams.params-in-req=Parametros neste pedido:
+requestparams.no-params=Sem Parametros, Por favor entre alguns
+requestparams.firstname=Primeiro Nome:
+requestparams.lastname=Apelido:
+
+cookies.title=CExamplo de Cookies
+cookies.cookies=O se browser esta a enviar os seguintes cookies:
+cookies.no-cookies=O seu browser nao esta a enviar nenhuns cookies
+cookies.make-cookie=Crie um cookie para enviar para o seu browser
+cookies.name=Nome:
+cookies.value=Valor:
+cookies.set=Acabou de enviar o seguinte cookie para o seu browser:
+
+sessions.title=Examplo de sessoes
+sessions.id=Identificador da Sessao:
+sessions.created=Criada:
+sessions.lastaccessed=Ultima vez acedida:
+sessions.data=Os seguintes dados fazem parte da sua sessao:
+sessions.adddata=Adicione data a sua sessao
+sessions.dataname=Nome do atributo da sessao:
+sessions.datavalue=Valor do atributo da Sessao:
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/RequestHeaderExample.class b/tomcat-uid/webapps/examples/WEB-INF/classes/RequestHeaderExample.class
new file mode 100644
index 0000000..8270f63
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/RequestHeaderExample.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/RequestHeaderExample.java b/tomcat-uid/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
new file mode 100644
index 0000000..2a550f2
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
@@ -0,0 +1,86 @@
+/*
+* 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.
+*/
+
+import java.io.*;
+import java.util.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import util.HTMLFilter;
+
+/**
+ * Example servlet showing request headers
+ *
+ * @author James Duncan Davidson <duncan@eng.sun.com>
+ */
+
+public class RequestHeaderExample extends HttpServlet {
+
+ ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
+
+ public void doGet(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ response.setContentType("text/html");
+
+ PrintWriter out = response.getWriter();
+ out.println("<html>");
+ out.println("<head>");
+
+ String title = rb.getString("requestheader.title");
+ out.println("<title>" + title + "</title>");
+ out.println("</head>");
+ out.println("<body bgcolor=\"white\">");
+
+ // all links relative
+
+ // XXX
+ // making these absolute till we work out the
+ // addition of a PathInfo issue
+
+ out.println("<a href=\"../reqheaders.html\">");
+ out.println("<img src=\"../images/code.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"view code\"></a>");
+ out.println("<a href=\"../index.html\">");
+ out.println("<img src=\"../images/return.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"return\"></a>");
+
+ out.println("<h3>" + title + "</h3>");
+ out.println("<table border=0>");
+ Enumeration e = request.getHeaderNames();
+ while (e.hasMoreElements()) {
+ String headerName = (String)e.nextElement();
+ String headerValue = request.getHeader(headerName);
+ out.println("<tr><td bgcolor=\"#CCCCCC\">");
+ out.println(HTMLFilter.filter(headerName));
+ out.println("</td><td>");
+ out.println(HTMLFilter.filter(headerValue));
+ out.println("</td></tr>");
+ }
+ out.println("</table>");
+ }
+
+ public void doPost(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ doGet(request, response);
+ }
+
+}
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/RequestInfoExample.class b/tomcat-uid/webapps/examples/WEB-INF/classes/RequestInfoExample.class
new file mode 100644
index 0000000..e93ed68
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/RequestInfoExample.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/RequestInfoExample.java b/tomcat-uid/webapps/examples/WEB-INF/classes/RequestInfoExample.java
new file mode 100644
index 0000000..86313e5
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/RequestInfoExample.java
@@ -0,0 +1,109 @@
+/*
+* 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.
+*/
+
+import java.io.*;
+import java.util.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import util.HTMLFilter;
+
+/**
+ * Example servlet showing request information.
+ *
+ * @author James Duncan Davidson <duncan@eng.sun.com>
+ */
+
+public class RequestInfoExample extends HttpServlet {
+
+
+ ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
+
+ public void doGet(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ response.setContentType("text/html");
+
+ PrintWriter out = response.getWriter();
+ out.println("<html>");
+ out.println("<head>");
+
+ String title = rb.getString("requestinfo.title");
+ out.println("<title>" + title + "</title>");
+ out.println("</head>");
+ out.println("<body bgcolor=\"white\">");
+
+ // img stuff not req'd for source code html showing
+ // all links relative!
+
+ // XXX
+ // making these absolute till we work out the
+ // addition of a PathInfo issue
+
+ out.println("<a href=\"../reqinfo.html\">");
+ out.println("<img src=\"../images/code.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"view code\"></a>");
+ out.println("<a href=\"../index.html\">");
+ out.println("<img src=\"../images/return.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"return\"></a>");
+
+ out.println("<h3>" + title + "</h3>");
+ out.println("<table border=0><tr><td>");
+ out.println(rb.getString("requestinfo.label.method"));
+ out.println("</td><td>");
+ out.println(HTMLFilter.filter(request.getMethod()));
+ out.println("</td></tr><tr><td>");
+ out.println(rb.getString("requestinfo.label.requesturi"));
+ out.println("</td><td>");
+ out.println(HTMLFilter.filter(request.getRequestURI()));
+ out.println("</td></tr><tr><td>");
+ out.println(rb.getString("requestinfo.label.protocol"));
+ out.println("</td><td>");
+ out.println(HTMLFilter.filter(request.getProtocol()));
+ out.println("</td></tr><tr><td>");
+ out.println(rb.getString("requestinfo.label.pathinfo"));
+ out.println("</td><td>");
+ out.println(HTMLFilter.filter(request.getPathInfo()));
+ out.println("</td></tr><tr><td>");
+ out.println(rb.getString("requestinfo.label.remoteaddr"));
+ out.println("</td><td>");
+ out.println(HTMLFilter.filter(request.getRemoteAddr()));
+ out.println("</td></tr>");
+
+ String cipherSuite=
+ (String)request.getAttribute("javax.servlet.request.cipher_suite");
+ if(cipherSuite!=null){
+ out.println("<tr><td>");
+ out.println("SSLCipherSuite:");
+ out.println("</td><td>");
+ out.println(HTMLFilter.filter(cipherSuite));
+ out.println("</td></tr>");
+ }
+
+ out.println("</table>");
+ }
+
+ public void doPost(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ doGet(request, response);
+ }
+
+}
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/RequestParamExample.class b/tomcat-uid/webapps/examples/WEB-INF/classes/RequestParamExample.class
new file mode 100644
index 0000000..dccd0ba
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/RequestParamExample.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/RequestParamExample.java b/tomcat-uid/webapps/examples/WEB-INF/classes/RequestParamExample.java
new file mode 100644
index 0000000..2b8b77c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/RequestParamExample.java
@@ -0,0 +1,102 @@
+/*
+* 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.
+*/
+
+import java.io.*;
+import java.util.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import util.HTMLFilter;
+
+/**
+ * Example servlet showing request headers
+ *
+ * @author James Duncan Davidson <duncan@eng.sun.com>
+ */
+
+public class RequestParamExample extends HttpServlet {
+
+
+ ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
+
+ public void doGet(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ response.setContentType("text/html");
+
+ PrintWriter out = response.getWriter();
+ out.println("<html>");
+ out.println("<head>");
+
+ String title = rb.getString("requestparams.title");
+ out.println("<title>" + title + "</title>");
+ out.println("</head>");
+ out.println("<body bgcolor=\"white\">");
+
+ // img stuff not req'd for source code html showing
+
+ // all links relative
+
+ // XXX
+ // making these absolute till we work out the
+ // addition of a PathInfo issue
+
+ out.println("<a href=\"../reqparams.html\">");
+ out.println("<img src=\"../images/code.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"view code\"></a>");
+ out.println("<a href=\"../index.html\">");
+ out.println("<img src=\"../images/return.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"return\"></a>");
+
+ out.println("<h3>" + title + "</h3>");
+ String firstName = request.getParameter("firstname");
+ String lastName = request.getParameter("lastname");
+ out.println(rb.getString("requestparams.params-in-req") + "<br>");
+ if (firstName != null || lastName != null) {
+ out.println(rb.getString("requestparams.firstname"));
+ out.println(" = " + HTMLFilter.filter(firstName) + "<br>");
+ out.println(rb.getString("requestparams.lastname"));
+ out.println(" = " + HTMLFilter.filter(lastName));
+ } else {
+ out.println(rb.getString("requestparams.no-params"));
+ }
+ out.println("<P>");
+ out.print("<form action=\"");
+ out.print("RequestParamExample\" ");
+ out.println("method=POST>");
+ out.println(rb.getString("requestparams.firstname"));
+ out.println("<input type=text size=20 name=firstname>");
+ out.println("<br>");
+ out.println(rb.getString("requestparams.lastname"));
+ out.println("<input type=text size=20 name=lastname>");
+ out.println("<br>");
+ out.println("<input type=submit>");
+ out.println("</form>");
+
+ out.println("</body>");
+ out.println("</html>");
+ }
+
+ public void doPost(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ doGet(request, response);
+ }
+
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/SessionExample.class b/tomcat-uid/webapps/examples/WEB-INF/classes/SessionExample.class
new file mode 100644
index 0000000..372e463
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/SessionExample.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/SessionExample.java b/tomcat-uid/webapps/examples/WEB-INF/classes/SessionExample.java
new file mode 100644
index 0000000..33f4f8f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/SessionExample.java
@@ -0,0 +1,133 @@
+/*
+* 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.
+*/
+
+import java.io.*;
+import java.util.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+import util.HTMLFilter;
+
+/**
+ * Example servlet showing request headers
+ *
+ * @author James Duncan Davidson <duncan@eng.sun.com>
+ */
+
+public class SessionExample extends HttpServlet {
+
+ ResourceBundle rb = ResourceBundle.getBundle("LocalStrings");
+
+ public void doGet(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ response.setContentType("text/html");
+
+ PrintWriter out = response.getWriter();
+ out.println("<html>");
+ out.println("<head>");
+
+ String title = rb.getString("sessions.title");
+ out.println("<title>" + title + "</title>");
+ out.println("</head>");
+ out.println("<body bgcolor=\"white\">");
+
+ // img stuff not req'd for source code html showing
+ // relative links everywhere!
+
+ // XXX
+ // making these absolute till we work out the
+ // addition of a PathInfo issue
+
+ out.println("<a href=\"../sessions.html\">");
+ out.println("<img src=\"../images/code.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"view code\"></a>");
+ out.println("<a href=\"../index.html\">");
+ out.println("<img src=\"../images/return.gif\" height=24 " +
+ "width=24 align=right border=0 alt=\"return\"></a>");
+
+ out.println("<h3>" + title + "</h3>");
+
+ HttpSession session = request.getSession(true);
+ out.println(rb.getString("sessions.id") + " " + session.getId());
+ out.println("<br>");
+ out.println(rb.getString("sessions.created") + " ");
+ out.println(new Date(session.getCreationTime()) + "<br>");
+ out.println(rb.getString("sessions.lastaccessed") + " ");
+ out.println(new Date(session.getLastAccessedTime()));
+
+ String dataName = request.getParameter("dataname");
+ String dataValue = request.getParameter("datavalue");
+ if (dataName != null && dataValue != null) {
+ session.setAttribute(dataName, dataValue);
+ }
+
+ out.println("<P>");
+ out.println(rb.getString("sessions.data") + "<br>");
+ Enumeration names = session.getAttributeNames();
+ while (names.hasMoreElements()) {
+ String name = (String) names.nextElement();
+ String value = session.getAttribute(name).toString();
+ out.println(HTMLFilter.filter(name) + " = "
+ + HTMLFilter.filter(value) + "<br>");
+ }
+
+ out.println("<P>");
+ out.print("<form action=\"");
+ out.print(response.encodeURL("SessionExample"));
+ out.print("\" ");
+ out.println("method=POST>");
+ out.println(rb.getString("sessions.dataname"));
+ out.println("<input type=text size=20 name=dataname>");
+ out.println("<br>");
+ out.println(rb.getString("sessions.datavalue"));
+ out.println("<input type=text size=20 name=datavalue>");
+ out.println("<br>");
+ out.println("<input type=submit>");
+ out.println("</form>");
+
+ out.println("<P>GET based form:<br>");
+ out.print("<form action=\"");
+ out.print(response.encodeURL("SessionExample"));
+ out.print("\" ");
+ out.println("method=GET>");
+ out.println(rb.getString("sessions.dataname"));
+ out.println("<input type=text size=20 name=dataname>");
+ out.println("<br>");
+ out.println(rb.getString("sessions.datavalue"));
+ out.println("<input type=text size=20 name=datavalue>");
+ out.println("<br>");
+ out.println("<input type=submit>");
+ out.println("</form>");
+
+ out.print("<p><a href=\"");
+ out.print(HTMLFilter.filter(response.encodeURL("SessionExample?dataname=foo&datavalue=bar")));
+ out.println("\" >URL encoded </a>");
+
+ out.println("</body>");
+ out.println("</html>");
+ }
+
+ public void doPost(HttpServletRequest request,
+ HttpServletResponse response)
+ throws IOException, ServletException
+ {
+ doGet(request, response);
+ }
+
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/cal/Entries.class b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/Entries.class
new file mode 100644
index 0000000..ab44434
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/Entries.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/cal/Entries.java b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/Entries.java
new file mode 100644
index 0000000..ea0867b
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/Entries.java
@@ -0,0 +1,72 @@
+/*
+* 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.
+*/
+package cal;
+
+import java.util.Hashtable;
+import javax.servlet.http.*;
+
+public class Entries {
+
+ private Hashtable entries;
+ private static final String[] time = {"8am", "9am", "10am", "11am", "12pm",
+ "1pm", "2pm", "3pm", "4pm", "5pm", "6pm",
+ "7pm", "8pm" };
+ public static final int rows = 12;
+
+ public Entries () {
+ entries = new Hashtable (rows);
+ for (int i=0; i < rows; i++) {
+ entries.put (time[i], new Entry(time[i]));
+ }
+ }
+
+ public int getRows () {
+ return rows;
+ }
+
+ public Entry getEntry (int index) {
+ return (Entry)this.entries.get(time[index]);
+ }
+
+ public int getIndex (String tm) {
+ for (int i=0; i<rows; i++)
+ if(tm.equals(time[i])) return i;
+ return -1;
+ }
+
+ public void processRequest (HttpServletRequest request, String tm) {
+ int index = getIndex (tm);
+ if (index >= 0) {
+ String descr = request.getParameter ("description");
+ ((Entry)entries.get(time[index])).setDescription (descr);
+ }
+ }
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/cal/Entry.class b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/Entry.class
new file mode 100644
index 0000000..b4619a6
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/Entry.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/cal/Entry.java b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/Entry.java
new file mode 100644
index 0000000..d4596d9
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/Entry.java
@@ -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.
+*/
+
+package cal;
+
+public class Entry {
+
+ String hour;
+ String description;
+ String color;
+
+ public Entry (String hour) {
+ this.hour = hour;
+ this.description = "";
+
+ }
+
+ public String getHour () {
+ return this.hour;
+ }
+
+ public String getColor () {
+ if (description.equals("")) return "lightblue";
+ else return "red";
+ }
+
+ public String getDescription () {
+ if (description.equals("")) return "None";
+ else return this.description;
+ }
+
+ public void setDescription (String descr) {
+ description = descr;
+ }
+
+}
+
+
+
+
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/cal/JspCalendar.class b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/JspCalendar.class
new file mode 100644
index 0000000..dfd95e1
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/JspCalendar.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/cal/JspCalendar.java b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/JspCalendar.java
new file mode 100644
index 0000000..b2db6c0
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/JspCalendar.java
@@ -0,0 +1,154 @@
+/*
+* 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.
+*/
+
+package cal;
+
+import java.util.*;
+
+public class JspCalendar {
+ Calendar calendar = null;
+ Date currentDate;
+
+ public JspCalendar() {
+ calendar = Calendar.getInstance();
+ Date trialTime = new Date();
+ calendar.setTime(trialTime);
+ }
+
+
+ public int getYear() {
+ return calendar.get(Calendar.YEAR);
+ }
+
+ public String getMonth() {
+ int m = getMonthInt();
+ String[] months = new String [] { "January", "February", "March",
+ "April", "May", "June",
+ "July", "August", "September",
+ "October", "November", "December" };
+ if (m > 12)
+ return "Unknown to Man";
+
+ return months[m - 1];
+
+ }
+
+ public String getDay() {
+ int x = getDayOfWeek();
+ String[] days = new String[] {"Sunday", "Monday", "Tuesday", "Wednesday",
+ "Thursday", "Friday", "Saturday"};
+
+ if (x > 7)
+ return "Unknown to Man";
+
+ return days[x - 1];
+
+ }
+
+ public int getMonthInt() {
+ return 1 + calendar.get(Calendar.MONTH);
+ }
+
+ public String getDate() {
+ return getMonthInt() + "/" + getDayOfMonth() + "/" + getYear();
+ }
+
+ public String getCurrentDate() {
+ Date dt = new Date ();
+ calendar.setTime (dt);
+ return getMonthInt() + "/" + getDayOfMonth() + "/" + getYear();
+
+ }
+
+ public String getNextDate() {
+ calendar.set (Calendar.DAY_OF_MONTH, getDayOfMonth() + 1);
+ return getDate ();
+ }
+
+ public String getPrevDate() {
+ calendar.set (Calendar.DAY_OF_MONTH, getDayOfMonth() - 1);
+ return getDate ();
+ }
+
+ public String getTime() {
+ return getHour() + ":" + getMinute() + ":" + getSecond();
+ }
+
+ public int getDayOfMonth() {
+ return calendar.get(Calendar.DAY_OF_MONTH);
+ }
+
+ public int getDayOfYear() {
+ return calendar.get(Calendar.DAY_OF_YEAR);
+ }
+
+ public int getWeekOfYear() {
+ return calendar.get(Calendar.WEEK_OF_YEAR);
+ }
+
+ public int getWeekOfMonth() {
+ return calendar.get(Calendar.WEEK_OF_MONTH);
+ }
+
+ public int getDayOfWeek() {
+ return calendar.get(Calendar.DAY_OF_WEEK);
+ }
+
+ public int getHour() {
+ return calendar.get(Calendar.HOUR_OF_DAY);
+ }
+
+ public int getMinute() {
+ return calendar.get(Calendar.MINUTE);
+ }
+
+
+ public int getSecond() {
+ return calendar.get(Calendar.SECOND);
+ }
+
+
+ public int getEra() {
+ return calendar.get(Calendar.ERA);
+ }
+
+ public String getUSTimeZone() {
+ String[] zones = new String[] {"Hawaii", "Alaskan", "Pacific",
+ "Mountain", "Central", "Eastern"};
+
+ return zones[10 + getZoneOffset()];
+ }
+
+ public int getZoneOffset() {
+ return calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000);
+ }
+
+
+ public int getDSTOffset() {
+ return calendar.get(Calendar.DST_OFFSET)/(60*60*1000);
+ }
+
+
+ public int getAMPM() {
+ return calendar.get(Calendar.AM_PM);
+ }
+}
+
+
+
+
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/cal/TableBean.class b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/TableBean.class
new file mode 100644
index 0000000..8afd547
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/TableBean.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/cal/TableBean.java b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/TableBean.java
new file mode 100644
index 0000000..f55327c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/cal/TableBean.java
@@ -0,0 +1,100 @@
+/*
+* 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.
+*/
+package cal;
+
+import javax.servlet.http.*;
+import java.util.Hashtable;
+
+public class TableBean {
+
+ Hashtable table;
+ JspCalendar JspCal;
+ Entries entries;
+ String date;
+ String name = null;
+ String email = null;
+ boolean processError = false;
+
+ public TableBean () {
+ this.table = new Hashtable (10);
+ this.JspCal = new JspCalendar ();
+ this.date = JspCal.getCurrentDate ();
+ }
+
+ public void setName (String nm) {
+ this.name = nm;
+ }
+
+ public String getName () {
+ return this.name;
+ }
+
+ public void setEmail (String mail) {
+ this.email = mail;
+ }
+
+ public String getEmail () {
+ return this.email;
+ }
+
+ public String getDate () {
+ return this.date;
+ }
+
+ public Entries getEntries () {
+ return this.entries;
+ }
+
+ public void processRequest (HttpServletRequest request) {
+
+ // Get the name and e-mail.
+ this.processError = false;
+ if (name == null || name.equals("")) setName(request.getParameter ("name"));
+ if (email == null || email.equals("")) setEmail(request.getParameter ("email"));
+ if (name == null || email == null ||
+ name.equals("") || email.equals("")) {
+ this.processError = true;
+ return;
+ }
+
+ // Get the date.
+ String dateR = request.getParameter ("date");
+ if (dateR == null) date = JspCal.getCurrentDate ();
+ else if (dateR.equalsIgnoreCase("next")) date = JspCal.getNextDate ();
+ else if (dateR.equalsIgnoreCase("prev")) date = JspCal.getPrevDate ();
+
+ entries = (Entries) table.get (date);
+ if (entries == null) {
+ entries = new Entries ();
+ table.put (date, entries);
+ }
+
+ // If time is provided add the event.
+ String time = request.getParameter("time");
+ if (time != null) entries.processRequest (request, time);
+ }
+
+ public boolean getProcessError () {
+ return this.processError;
+ }
+}
+
+
+
+
+
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/chat/ChatServlet$MessageSender.class b/tomcat-uid/webapps/examples/WEB-INF/classes/chat/ChatServlet$MessageSender.class
new file mode 100644
index 0000000..6712d68
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/chat/ChatServlet$MessageSender.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/chat/ChatServlet.class b/tomcat-uid/webapps/examples/WEB-INF/classes/chat/ChatServlet.class
new file mode 100644
index 0000000..752adba
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/chat/ChatServlet.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/chat/ChatServlet.java b/tomcat-uid/webapps/examples/WEB-INF/classes/chat/ChatServlet.java
new file mode 100644
index 0000000..11d3757
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/chat/ChatServlet.java
@@ -0,0 +1,293 @@
+/*
+ * 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.
+ */
+
+
+package chat;
+
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+
+import org.apache.catalina.CometEvent;
+import org.apache.catalina.CometProcessor;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+
+/**
+ * Helper class to implement Comet functionality.
+ */
+public class ChatServlet
+ extends HttpServlet implements CometProcessor {
+
+ private static final String CHARSET = "UTF-8";
+
+ protected ArrayList<HttpServletResponse> connections =
+ new ArrayList<HttpServletResponse>();
+ protected MessageSender messageSender = null;
+
+ public void init() throws ServletException {
+ messageSender = new MessageSender();
+ Thread messageSenderThread =
+ new Thread(messageSender, "MessageSender[" + getServletContext().getContextPath() + "]");
+ messageSenderThread.setDaemon(true);
+ messageSenderThread.start();
+ }
+
+ public void destroy() {
+ connections.clear();
+ messageSender.stop();
+ messageSender = null;
+ }
+
+ /**
+ * Process the given Comet event.
+ *
+ * @param event The Comet event that will be processed
+ * @throws IOException
+ * @throws ServletException
+ */
+ public void event(CometEvent event)
+ throws IOException, ServletException {
+
+ // Note: There should really be two servlets in this example, to avoid
+ // mixing Comet stuff with regular connection processing
+ HttpServletRequest request = event.getHttpServletRequest();
+ HttpServletResponse response = event.getHttpServletResponse();
+
+ if (event.getEventType() == CometEvent.EventType.BEGIN) {
+ String action = request.getParameter("action");
+ if (action != null) {
+ if ("login".equals(action)) {
+ String nickname = request.getParameter("nickname");
+ request.getSession(true).setAttribute("nickname", nickname);
+ response.sendRedirect("index.jsp");
+ event.close();
+ return;
+ } else {
+ String nickname = (String) request.getSession(true).getAttribute("nickname");
+ String message = request.getParameter("message");
+ messageSender.send(nickname, message);
+ response.sendRedirect("post.jsp");
+ event.close();
+ return;
+ }
+ } else {
+ if (request.getSession(true).getAttribute("nickname") == null) {
+ // Redirect to "login"
+ log("Redirect to login for session: " + request.getSession(true).getId());
+ response.sendRedirect("login.jsp");
+ event.close();
+ return;
+ }
+ }
+ begin(event, request, response);
+ } else if (event.getEventType() == CometEvent.EventType.ERROR) {
+ error(event, request, response);
+ } else if (event.getEventType() == CometEvent.EventType.END) {
+ end(event, request, response);
+ } else if (event.getEventType() == CometEvent.EventType.READ) {
+ read(event, request, response);
+ }
+ }
+
+ protected void begin(CometEvent event, HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException {
+ log("Begin for session: " + request.getSession(true).getId());
+
+ response.setContentType("text/html; charset=" + CHARSET);
+
+ PrintWriter writer = response.getWriter();
+ writer.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
+ writer.println("<html><head><title>JSP Chat</title></head><body bgcolor=\"#FFFFFF\">");
+ writer.println("<div>Welcome to the chat. <a href='chat'>Click here to reload this window</a></div>");
+ writer.flush();
+
+ synchronized(connections) {
+ connections.add(response);
+ }
+
+ messageSender.send("Tomcat", request.getSession(true).getAttribute("nickname") + " joined the chat.");
+ }
+
+ protected void end(CometEvent event, HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException {
+ log("End for session: " + request.getSession(true).getId());
+ synchronized(connections) {
+ connections.remove(response);
+ }
+
+ PrintWriter writer = response.getWriter();
+ writer.println("</body></html>");
+
+ event.close();
+ }
+
+ protected void error(CometEvent event, HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException {
+ log("Error for session: " + request.getSession(true).getId());
+ synchronized(connections) {
+ connections.remove(response);
+ }
+ event.close();
+ }
+
+ protected void read(CometEvent event, HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException {
+ InputStream is = request.getInputStream();
+ byte[] buf = new byte[512];
+ while (is.available() > 0) {
+ log("Available: " + is.available());
+ int n = is.read(buf);
+ if (n > 0) {
+ log("Read " + n + " bytes: " + new String(buf, 0, n)
+ + " for session: " + request.getSession(true).getId());
+ } else if (n < 0) {
+ log("End of file: " + n);
+ end(event, request, response);
+ return;
+ }
+ }
+ }
+
+ protected void service(HttpServletRequest request, HttpServletResponse response)
+ throws IOException, ServletException {
+ // Compatibility method: equivalent method using the regular connection model
+ response.setContentType("text/html; charset=" + CHARSET);
+ PrintWriter writer = response.getWriter();
+ writer.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">");
+ writer.println("<html><head><title>JSP Chat</title></head><body bgcolor=\"#FFFFFF\">");
+ writer.println("Chat example only supports Comet processing. ");
+ writer.println("Configure a connector that supports Comet and try again.");
+ writer.println("</body></html>");
+ }
+
+
+ /**
+ * Poller class.
+ */
+ public class MessageSender implements Runnable {
+
+ protected boolean running = true;
+ protected ArrayList<String> messages = new ArrayList<String>();
+
+ public MessageSender() {
+ }
+
+ public void stop() {
+ running = false;
+ synchronized (messages) {
+ messages.notify();
+ }
+ }
+
+ /**
+ * Add specified socket and associated pool to the poller. The socket will
+ * be added to a temporary array, and polled first after a maximum amount
+ * of time equal to pollTime (in most cases, latency will be much lower,
+ * however).
+ *
+ * @param socket to add to the poller
+ */
+ public void send(String user, String message) {
+ synchronized (messages) {
+ messages.add("[" + user + "]: " + message);
+ messages.notify();
+ }
+ }
+
+ /**
+ * The background thread that listens for incoming TCP/IP connections and
+ * hands them off to an appropriate processor.
+ */
+ public void run() {
+
+ // Loop until we receive a shutdown command
+ while (running) {
+ String[] pendingMessages;
+ synchronized (messages) {
+ try {
+ if (messages.size() == 0) {
+ messages.wait();
+ }
+ } catch (InterruptedException e) {
+ // Ignore
+ }
+ pendingMessages = messages.toArray(new String[0]);
+ messages.clear();
+ }
+
+ synchronized (connections) {
+ for (int i = 0; i < connections.size(); i++) {
+ try {
+ PrintWriter writer = connections.get(i).getWriter();
+ for (int j = 0; j < pendingMessages.length; j++) {
+ writer.println("<div>"+filter(pendingMessages[j]) + "</div>");
+ }
+ writer.flush();
+ } catch (IOException e) {
+ log("IOException sending message", e);
+ }
+ }
+ }
+
+ }
+
+ }
+
+ }
+
+ /**
+ * Filter the specified message string for characters that are sensitive
+ * in HTML.
+ *
+ * @param message The message string to be filtered
+ * @author Copied from org.apache.catalina.util.RequestUtil#filter(String)
+ */
+ protected static String filter(String message) {
+ if (message == null)
+ return (null);
+
+ char content[] = new char[message.length()];
+ message.getChars(0, message.length(), content, 0);
+ StringBuilder result = new StringBuilder(content.length + 50);
+ for (int i = 0; i < content.length; i++) {
+ switch (content[i]) {
+ case '<':
+ result.append("<");
+ break;
+ case '>':
+ result.append(">");
+ break;
+ case '&':
+ result.append("&");
+ break;
+ case '"':
+ result.append(""");
+ break;
+ default:
+ result.append(content[i]);
+ }
+ }
+ return (result.toString());
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/checkbox/CheckTest.class b/tomcat-uid/webapps/examples/WEB-INF/classes/checkbox/CheckTest.class
new file mode 100644
index 0000000..87011a7
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/checkbox/CheckTest.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/checkbox/CheckTest.java b/tomcat-uid/webapps/examples/WEB-INF/classes/checkbox/CheckTest.java
new file mode 100644
index 0000000..70623e2
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/checkbox/CheckTest.java
@@ -0,0 +1,31 @@
+/*
+* 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.
+*/
+
+package checkbox;
+
+public class CheckTest {
+
+ String b[] = new String[] { "1", "2", "3", "4" };
+
+ public String[] getFruit() {
+ return b;
+ }
+
+ public void setFruit(String [] b) {
+ this.b = b;
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/colors/ColorGameBean.class b/tomcat-uid/webapps/examples/WEB-INF/classes/colors/ColorGameBean.class
new file mode 100644
index 0000000..408dc45
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/colors/ColorGameBean.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/colors/ColorGameBean.java b/tomcat-uid/webapps/examples/WEB-INF/classes/colors/ColorGameBean.java
new file mode 100644
index 0000000..5748217
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/colors/ColorGameBean.java
@@ -0,0 +1,115 @@
+/*
+* 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.
+*/
+package colors;
+
+import javax.servlet.http.*;
+
+public class ColorGameBean {
+
+ private String background = "yellow";
+ private String foreground = "red";
+ private String color1 = foreground;
+ private String color2 = background;
+ private String hint = "no";
+ private int attempts = 0;
+ private int intval = 0;
+ private boolean tookHints = false;
+
+ public void processRequest(HttpServletRequest request) {
+
+ // background = "yellow";
+ // foreground = "red";
+
+ if (! color1.equals(foreground)) {
+ if (color1.equalsIgnoreCase("black") ||
+ color1.equalsIgnoreCase("cyan")) {
+ background = color1;
+ }
+ }
+
+ if (! color2.equals(background)) {
+ if (color2.equalsIgnoreCase("black") ||
+ color2.equalsIgnoreCase("cyan")) {
+ foreground = color2;
+ }
+ }
+
+ attempts++;
+ }
+
+ public void setColor2(String x) {
+ color2 = x;
+ }
+
+ public void setColor1(String x) {
+ color1 = x;
+ }
+
+ public void setAction(String x) {
+ if (!tookHints)
+ tookHints = x.equalsIgnoreCase("Hint");
+ hint = x;
+ }
+
+ public String getColor2() {
+ return background;
+ }
+
+ public String getColor1() {
+ return foreground;
+ }
+
+ public int getAttempts() {
+ return attempts;
+ }
+
+ public boolean getHint() {
+ return hint.equalsIgnoreCase("Hint");
+ }
+
+ public boolean getSuccess() {
+ if (background.equalsIgnoreCase("black") ||
+ background.equalsIgnoreCase("cyan")) {
+
+ if (foreground.equalsIgnoreCase("black") ||
+ foreground.equalsIgnoreCase("cyan"))
+ return true;
+ else
+ return false;
+ }
+
+ return false;
+ }
+
+ public boolean getHintTaken() {
+ return tookHints;
+ }
+
+ public void reset() {
+ foreground = "red";
+ background = "yellow";
+ }
+
+ public void setIntval(int value) {
+ intval = value;
+ }
+
+ public int getIntval() {
+ return intval;
+ }
+}
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.class b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.class
new file mode 100644
index 0000000..619a1a2
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
new file mode 100644
index 0000000..fc298e2
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilter.java
@@ -0,0 +1,217 @@
+/*
+* 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.
+*/
+
+package compressionFilters;
+
+import java.io.IOException;
+import java.util.Enumeration;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+
+/**
+ * Implementation of <code>javax.servlet.Filter</code> used to compress
+ * the ServletResponse if it is bigger than a threshold.
+ *
+ * @author Amy Roh
+ * @author Dmitri Valdin
+ */
+public class CompressionFilter implements Filter{
+
+ /**
+ * The filter configuration object we are associated with. If this value
+ * is null, this filter instance is not currently configured.
+ */
+ private FilterConfig config = null;
+
+ /**
+ * Minimal reasonable threshold
+ */
+ private int minThreshold = 128;
+
+
+ /**
+ * The threshold number to compress
+ */
+ protected int compressionThreshold;
+
+ /**
+ * Debug level for this filter
+ */
+ private int debug = 0;
+
+ /**
+ * Place this filter into service.
+ *
+ * @param filterConfig The filter configuration object
+ */
+
+ public void init(FilterConfig filterConfig) {
+
+ config = filterConfig;
+ if (filterConfig != null) {
+ String value = filterConfig.getInitParameter("debug");
+ if (value!=null) {
+ debug = Integer.parseInt(value);
+ } else {
+ debug = 0;
+ }
+ String str = filterConfig.getInitParameter("compressionThreshold");
+ if (str!=null) {
+ compressionThreshold = Integer.parseInt(str);
+ if (compressionThreshold != 0 && compressionThreshold < minThreshold) {
+ if (debug > 0) {
+ System.out.println("compressionThreshold should be either 0 - no compression or >= " + minThreshold);
+ System.out.println("compressionThreshold set to " + minThreshold);
+ }
+ compressionThreshold = minThreshold;
+ }
+ } else {
+ compressionThreshold = 0;
+ }
+
+ } else {
+ compressionThreshold = 0;
+ }
+
+ }
+
+ /**
+ * Take this filter out of service.
+ */
+ public void destroy() {
+
+ this.config = null;
+
+ }
+
+ /**
+ * The <code>doFilter</code> method of the Filter is called by the container
+ * each time a request/response pair is passed through the chain due
+ * to a client request for a resource at the end of the chain.
+ * The FilterChain passed into this method allows the Filter to pass on the
+ * request and response to the next entity in the chain.<p>
+ * This method first examines the request to check whether the client support
+ * compression. <br>
+ * It simply just pass the request and response if there is no support for
+ * compression.<br>
+ * If the compression support is available, it creates a
+ * CompressionServletResponseWrapper object which compresses the content and
+ * modifies the header if the content length is big enough.
+ * It then invokes the next entity in the chain using the FilterChain object
+ * (<code>chain.doFilter()</code>), <br>
+ **/
+
+ public void doFilter ( ServletRequest request, ServletResponse response,
+ FilterChain chain ) throws IOException, ServletException {
+
+ if (debug > 0) {
+ System.out.println("@doFilter");
+ }
+
+ if (compressionThreshold == 0) {
+ if (debug > 0) {
+ System.out.println("doFilter gets called, but compressionTreshold is set to 0 - no compression");
+ }
+ chain.doFilter(request, response);
+ return;
+ }
+
+ boolean supportCompression = false;
+ if (request instanceof HttpServletRequest) {
+ if (debug > 1) {
+ System.out.println("requestURI = " + ((HttpServletRequest)request).getRequestURI());
+ }
+
+ // Are we allowed to compress ?
+ String s = (String) ((HttpServletRequest)request).getParameter("gzip");
+ if ("false".equals(s)) {
+ if (debug > 0) {
+ System.out.println("got parameter gzip=false --> don't compress, just chain filter");
+ }
+ chain.doFilter(request, response);
+ return;
+ }
+
+ Enumeration e =
+ ((HttpServletRequest)request).getHeaders("Accept-Encoding");
+ while (e.hasMoreElements()) {
+ String name = (String)e.nextElement();
+ if (name.indexOf("gzip") != -1) {
+ if (debug > 0) {
+ System.out.println("supports compression");
+ }
+ supportCompression = true;
+ } else {
+ if (debug > 0) {
+ System.out.println("no support for compresion");
+ }
+ }
+ }
+ }
+
+ if (!supportCompression) {
+ if (debug > 0) {
+ System.out.println("doFilter gets called wo compression");
+ }
+ chain.doFilter(request, response);
+ return;
+ } else {
+ if (response instanceof HttpServletResponse) {
+ CompressionServletResponseWrapper wrappedResponse =
+ new CompressionServletResponseWrapper((HttpServletResponse)response);
+ wrappedResponse.setDebugLevel(debug);
+ wrappedResponse.setCompressionThreshold(compressionThreshold);
+ if (debug > 0) {
+ System.out.println("doFilter gets called with compression");
+ }
+ try {
+ chain.doFilter(request, wrappedResponse);
+ } finally {
+ wrappedResponse.finishResponse();
+ }
+ return;
+ }
+ }
+ }
+
+ /**
+ * Set filter config
+ * This function is equivalent to init. Required by Weblogic 6.1
+ *
+ * @param filterConfig The filter configuration object
+ */
+ public void setFilterConfig(FilterConfig filterConfig) {
+ init(filterConfig);
+ }
+
+ /**
+ * Return filter config
+ * Required by Weblogic 6.1
+ */
+ public FilterConfig getFilterConfig() {
+ return config;
+ }
+
+}
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.class b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.class
new file mode 100644
index 0000000..a48332d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.java b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.java
new file mode 100644
index 0000000..9f6090a
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionFilterTestServlet.java
@@ -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.
+*/
+
+package compressionFilters;
+
+import java.io.IOException;
+import java.util.Enumeration;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+/**
+ * Very Simple test servlet to test compression filter
+ * @author Amy Roh
+ */
+public class CompressionFilterTestServlet extends HttpServlet {
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+
+ ServletOutputStream out = response.getOutputStream();
+ response.setContentType("text/plain");
+
+ Enumeration e = ((HttpServletRequest)request).getHeaders("Accept-Encoding");
+ while (e.hasMoreElements()) {
+ String name = (String)e.nextElement();
+ out.println(name);
+ if (name.indexOf("gzip") != -1) {
+ out.println("gzip supported -- able to compress");
+ }
+ else {
+ out.println("gzip not supported");
+ }
+ }
+
+
+ out.println("Compression Filter Test Servlet");
+ out.close();
+ }
+
+}
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionResponseStream.class b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionResponseStream.class
new file mode 100644
index 0000000..a52f332
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionResponseStream.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionResponseStream.java b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionResponseStream.java
new file mode 100644
index 0000000..120b82a
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionResponseStream.java
@@ -0,0 +1,322 @@
+/*
+* 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.
+*/
+package compressionFilters;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.zip.GZIPOutputStream;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+
+
+/**
+ * Implementation of <b>ServletOutputStream</b> that works with
+ * the CompressionServletResponseWrapper implementation.
+ *
+ * @author Amy Roh
+ * @author Dmitri Valdin
+ */
+public class CompressionResponseStream
+ extends ServletOutputStream {
+
+
+ // ----------------------------------------------------------- Constructors
+
+
+ /**
+ * Construct a servlet output stream associated with the specified Response.
+ *
+ * @param response The associated response
+ */
+ public CompressionResponseStream(HttpServletResponse response) throws IOException{
+
+ super();
+ closed = false;
+ this.response = response;
+ this.output = response.getOutputStream();
+
+ }
+
+
+ // ----------------------------------------------------- Instance Variables
+
+
+ /**
+ * The threshold number which decides to compress or not.
+ * Users can configure in web.xml to set it to fit their needs.
+ */
+ protected int compressionThreshold = 0;
+
+ /**
+ * Debug level
+ */
+ private int debug = 0;
+
+ /**
+ * The buffer through which all of our output bytes are passed.
+ */
+ protected byte[] buffer = null;
+
+ /**
+ * The number of data bytes currently in the buffer.
+ */
+ protected int bufferCount = 0;
+
+ /**
+ * The underlying gzip output stream to which we should write data.
+ */
+ protected OutputStream gzipstream = null;
+
+ /**
+ * Has this stream been closed?
+ */
+ protected boolean closed = false;
+
+ /**
+ * The content length past which we will not write, or -1 if there is
+ * no defined content length.
+ */
+ protected int length = -1;
+
+ /**
+ * The response with which this servlet output stream is associated.
+ */
+ protected HttpServletResponse response = null;
+
+ /**
+ * The underlying servket output stream to which we should write data.
+ */
+ protected ServletOutputStream output = null;
+
+
+ // --------------------------------------------------------- Public Methods
+
+ /**
+ * Set debug level
+ */
+ public void setDebugLevel(int debug) {
+ this.debug = debug;
+ }
+
+
+ /**
+ * Set the compressionThreshold number and create buffer for this size
+ */
+ protected void setBuffer(int threshold) {
+ compressionThreshold = threshold;
+ buffer = new byte[compressionThreshold];
+ if (debug > 1) {
+ System.out.println("buffer is set to "+compressionThreshold);
+ }
+ }
+
+ /**
+ * Close this output stream, causing any buffered data to be flushed and
+ * any further output data to throw an IOException.
+ */
+ public void close() throws IOException {
+
+ if (debug > 1) {
+ System.out.println("close() @ CompressionResponseStream");
+ }
+ if (closed)
+ throw new IOException("This output stream has already been closed");
+
+ if (gzipstream != null) {
+ flushToGZip();
+ gzipstream.close();
+ gzipstream = null;
+ } else {
+ if (bufferCount > 0) {
+ if (debug > 2) {
+ System.out.print("output.write(");
+ System.out.write(buffer, 0, bufferCount);
+ System.out.println(")");
+ }
+ output.write(buffer, 0, bufferCount);
+ bufferCount = 0;
+ }
+ }
+
+ output.close();
+ closed = true;
+
+ }
+
+
+ /**
+ * Flush any buffered data for this output stream, which also causes the
+ * response to be committed.
+ */
+ public void flush() throws IOException {
+
+ if (debug > 1) {
+ System.out.println("flush() @ CompressionResponseStream");
+ }
+ if (closed) {
+ throw new IOException("Cannot flush a closed output stream");
+ }
+
+ if (gzipstream != null) {
+ gzipstream.flush();
+ }
+
+ }
+
+ public void flushToGZip() throws IOException {
+
+ if (debug > 1) {
+ System.out.println("flushToGZip() @ CompressionResponseStream");
+ }
+ if (bufferCount > 0) {
+ if (debug > 1) {
+ System.out.println("flushing out to GZipStream, bufferCount = " + bufferCount);
+ }
+ writeToGZip(buffer, 0, bufferCount);
+ bufferCount = 0;
+ }
+
+ }
+
+ /**
+ * Write the specified byte to our output stream.
+ *
+ * @param b The byte to be written
+ *
+ * @exception IOException if an input/output error occurs
+ */
+ public void write(int b) throws IOException {
+
+ if (debug > 1) {
+ System.out.println("write "+b+" in CompressionResponseStream ");
+ }
+ if (closed)
+ throw new IOException("Cannot write to a closed output stream");
+
+ if (bufferCount >= buffer.length) {
+ flushToGZip();
+ }
+
+ buffer[bufferCount++] = (byte) b;
+
+ }
+
+
+ /**
+ * Write <code>b.length</code> bytes from the specified byte array
+ * to our output stream.
+ *
+ * @param b The byte array to be written
+ *
+ * @exception IOException if an input/output error occurs
+ */
+ public void write(byte b[]) throws IOException {
+
+ write(b, 0, b.length);
+
+ }
+
+
+ /**
+ * Write <code>len</code> bytes from the specified byte array, starting
+ * at the specified offset, to our output stream.
+ *
+ * @param b The byte array containing the bytes to be written
+ * @param off Zero-relative starting offset of the bytes to be written
+ * @param len The number of bytes to be written
+ *
+ * @exception IOException if an input/output error occurs
+ */
+ public void write(byte b[], int off, int len) throws IOException {
+
+ if (debug > 1) {
+ System.out.println("write, bufferCount = " + bufferCount + " len = " + len + " off = " + off);
+ }
+ if (debug > 2) {
+ System.out.print("write(");
+ System.out.write(b, off, len);
+ System.out.println(")");
+ }
+
+ if (closed)
+ throw new IOException("Cannot write to a closed output stream");
+
+ if (len == 0)
+ return;
+
+ // Can we write into buffer ?
+ if (len <= (buffer.length - bufferCount)) {
+ System.arraycopy(b, off, buffer, bufferCount, len);
+ bufferCount += len;
+ return;
+ }
+
+ // There is not enough space in buffer. Flush it ...
+ flushToGZip();
+
+ // ... and try again. Note, that bufferCount = 0 here !
+ if (len <= (buffer.length - bufferCount)) {
+ System.arraycopy(b, off, buffer, bufferCount, len);
+ bufferCount += len;
+ return;
+ }
+
+ // write direct to gzip
+ writeToGZip(b, off, len);
+ }
+
+ public void writeToGZip(byte b[], int off, int len) throws IOException {
+
+ if (debug > 1) {
+ System.out.println("writeToGZip, len = " + len);
+ }
+ if (debug > 2) {
+ System.out.print("writeToGZip(");
+ System.out.write(b, off, len);
+ System.out.println(")");
+ }
+ if (gzipstream == null) {
+ if (debug > 1) {
+ System.out.println("new GZIPOutputStream");
+ }
+ if (response.isCommitted()) {
+ if (debug > 1)
+ System.out.print("Response already committed. Using original output stream");
+ gzipstream = output;
+ } else {
+ response.addHeader("Content-Encoding", "gzip");
+ gzipstream = new GZIPOutputStream(output);
+ }
+ }
+ gzipstream.write(b, off, len);
+
+ }
+
+
+ // -------------------------------------------------------- Package Methods
+
+
+ /**
+ * Has this response stream been closed?
+ */
+ public boolean closed() {
+
+ return (this.closed);
+
+ }
+
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.class b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.class
new file mode 100644
index 0000000..838e08c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java
new file mode 100644
index 0000000..e2cd66b
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/compressionFilters/CompressionServletResponseWrapper.java
@@ -0,0 +1,243 @@
+/*
+* 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.
+*/
+package compressionFilters;
+
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+
+/**
+ * Implementation of <b>HttpServletResponseWrapper</b> that works with
+ * the CompressionServletResponseStream implementation..
+ *
+ * @author Amy Roh
+ * @author Dmitri Valdin
+ */
+public class CompressionServletResponseWrapper extends HttpServletResponseWrapper {
+
+ // ----------------------------------------------------- Constructor
+
+ /**
+ * Calls the parent constructor which creates a ServletResponse adaptor
+ * wrapping the given response object.
+ */
+
+ public CompressionServletResponseWrapper(HttpServletResponse response) {
+ super(response);
+ origResponse = response;
+ if (debug > 1) {
+ System.out.println("CompressionServletResponseWrapper constructor gets called");
+ }
+ }
+
+
+ // ----------------------------------------------------- Instance Variables
+
+ /**
+ * Original response
+ */
+
+ protected HttpServletResponse origResponse = null;
+
+ /**
+ * Descriptive information about this Response implementation.
+ */
+
+ protected static final String info = "CompressionServletResponseWrapper";
+
+ /**
+ * The ServletOutputStream that has been returned by
+ * <code>getOutputStream()</code>, if any.
+ */
+
+ protected ServletOutputStream stream = null;
+
+
+ /**
+ * The PrintWriter that has been returned by
+ * <code>getWriter()</code>, if any.
+ */
+
+ protected PrintWriter writer = null;
+
+ /**
+ * The threshold number to compress
+ */
+ protected int threshold = 0;
+
+ /**
+ * Debug level
+ */
+ private int debug = 0;
+
+ /**
+ * Content type
+ */
+ protected String contentType = null;
+
+ // --------------------------------------------------------- Public Methods
+
+
+ /**
+ * Set content type
+ */
+ public void setContentType(String contentType) {
+ if (debug > 1) {
+ System.out.println("setContentType to "+contentType);
+ }
+ this.contentType = contentType;
+ origResponse.setContentType(contentType);
+ }
+
+
+ /**
+ * Set threshold number
+ */
+ public void setCompressionThreshold(int threshold) {
+ if (debug > 1) {
+ System.out.println("setCompressionThreshold to " + threshold);
+ }
+ this.threshold = threshold;
+ }
+
+
+ /**
+ * Set debug level
+ */
+ public void setDebugLevel(int debug) {
+ this.debug = debug;
+ }
+
+
+ /**
+ * Create and return a ServletOutputStream to write the content
+ * associated with this Response.
+ *
+ * @exception IOException if an input/output error occurs
+ */
+ public ServletOutputStream createOutputStream() throws IOException {
+ if (debug > 1) {
+ System.out.println("createOutputStream gets called");
+ }
+
+ CompressionResponseStream stream = new CompressionResponseStream(origResponse);
+ stream.setDebugLevel(debug);
+ stream.setBuffer(threshold);
+
+ return stream;
+
+ }
+
+
+ /**
+ * Finish a response.
+ */
+ public void finishResponse() {
+ try {
+ if (writer != null) {
+ writer.close();
+ } else {
+ if (stream != null)
+ stream.close();
+ }
+ } catch (IOException e) {
+ }
+ }
+
+
+ // ------------------------------------------------ ServletResponse Methods
+
+
+ /**
+ * Flush the buffer and commit this response.
+ *
+ * @exception IOException if an input/output error occurs
+ */
+ public void flushBuffer() throws IOException {
+ if (debug > 1) {
+ System.out.println("flush buffer @ CompressionServletResponseWrapper");
+ }
+ ((CompressionResponseStream)stream).flush();
+
+ }
+
+ /**
+ * Return the servlet output stream associated with this Response.
+ *
+ * @exception IllegalStateException if <code>getWriter</code> has
+ * already been called for this response
+ * @exception IOException if an input/output error occurs
+ */
+ public ServletOutputStream getOutputStream() throws IOException {
+
+ if (writer != null)
+ throw new IllegalStateException("getWriter() has already been called for this response");
+
+ if (stream == null)
+ stream = createOutputStream();
+ if (debug > 1) {
+ System.out.println("stream is set to "+stream+" in getOutputStream");
+ }
+
+ return (stream);
+
+ }
+
+ /**
+ * Return the writer associated with this Response.
+ *
+ * @exception IllegalStateException if <code>getOutputStream</code> has
+ * already been called for this response
+ * @exception IOException if an input/output error occurs
+ */
+ public PrintWriter getWriter() throws IOException {
+
+ if (writer != null)
+ return (writer);
+
+ if (stream != null)
+ throw new IllegalStateException("getOutputStream() has already been called for this response");
+
+ stream = createOutputStream();
+ if (debug > 1) {
+ System.out.println("stream is set to "+stream+" in getWriter");
+ }
+ //String charset = getCharsetFromContentType(contentType);
+ String charEnc = origResponse.getCharacterEncoding();
+ if (debug > 1) {
+ System.out.println("character encoding is " + charEnc);
+ }
+ // HttpServletResponse.getCharacterEncoding() shouldn't return null
+ // according the spec, so feel free to remove that "if"
+ if (charEnc != null) {
+ writer = new PrintWriter(new OutputStreamWriter(stream, charEnc));
+ } else {
+ writer = new PrintWriter(stream);
+ }
+
+ return (writer);
+
+ }
+
+
+ public void setContentLength(int length) {
+ }
+
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/dates/JspCalendar.class b/tomcat-uid/webapps/examples/WEB-INF/classes/dates/JspCalendar.class
new file mode 100644
index 0000000..7ae66d3
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/dates/JspCalendar.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/dates/JspCalendar.java b/tomcat-uid/webapps/examples/WEB-INF/classes/dates/JspCalendar.java
new file mode 100644
index 0000000..22e1f86
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/dates/JspCalendar.java
@@ -0,0 +1,152 @@
+/*
+* 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.
+*/
+package dates;
+
+import java.util.*;
+
+public class JspCalendar {
+ Calendar calendar = null;
+
+ public JspCalendar() {
+ calendar = Calendar.getInstance();
+ Date trialTime = new Date();
+ calendar.setTime(trialTime);
+ }
+
+ public int getYear() {
+ return calendar.get(Calendar.YEAR);
+ }
+
+ public String getMonth() {
+ int m = getMonthInt();
+ String[] months = new String [] { "January", "February", "March",
+ "April", "May", "June",
+ "July", "August", "September",
+ "October", "November", "December" };
+ if (m > 12)
+ return "Unknown to Man";
+
+ return months[m - 1];
+
+ }
+
+ public String getDay() {
+ int x = getDayOfWeek();
+ String[] days = new String[] {"Sunday", "Monday", "Tuesday", "Wednesday",
+ "Thursday", "Friday", "Saturday"};
+
+ if (x > 7)
+ return "Unknown to Man";
+
+ return days[x - 1];
+
+ }
+
+ public int getMonthInt() {
+ return 1 + calendar.get(Calendar.MONTH);
+ }
+
+ public String getDate() {
+ return getMonthInt() + "/" + getDayOfMonth() + "/" + getYear();
+
+ }
+
+ public String getTime() {
+ return getHour() + ":" + getMinute() + ":" + getSecond();
+ }
+
+ public int getDayOfMonth() {
+ return calendar.get(Calendar.DAY_OF_MONTH);
+ }
+
+ public int getDayOfYear() {
+ return calendar.get(Calendar.DAY_OF_YEAR);
+ }
+
+ public int getWeekOfYear() {
+ return calendar.get(Calendar.WEEK_OF_YEAR);
+ }
+
+ public int getWeekOfMonth() {
+ return calendar.get(Calendar.WEEK_OF_MONTH);
+ }
+
+ public int getDayOfWeek() {
+ return calendar.get(Calendar.DAY_OF_WEEK);
+ }
+
+ public int getHour() {
+ return calendar.get(Calendar.HOUR_OF_DAY);
+ }
+
+ public int getMinute() {
+ return calendar.get(Calendar.MINUTE);
+ }
+
+
+ public int getSecond() {
+ return calendar.get(Calendar.SECOND);
+ }
+
+ public static void main(String args[]) {
+ JspCalendar db = new JspCalendar();
+ p("date: " + db.getDayOfMonth());
+ p("year: " + db.getYear());
+ p("month: " + db.getMonth());
+ p("time: " + db.getTime());
+ p("date: " + db.getDate());
+ p("Day: " + db.getDay());
+ p("DayOfYear: " + db.getDayOfYear());
+ p("WeekOfYear: " + db.getWeekOfYear());
+ p("era: " + db.getEra());
+ p("ampm: " + db.getAMPM());
+ p("DST: " + db.getDSTOffset());
+ p("ZONE Offset: " + db.getZoneOffset());
+ p("TIMEZONE: " + db.getUSTimeZone());
+ }
+
+ private static void p(String x) {
+ System.out.println(x);
+ }
+
+
+ public int getEra() {
+ return calendar.get(Calendar.ERA);
+ }
+
+ public String getUSTimeZone() {
+ String[] zones = new String[] {"Hawaii", "Alaskan", "Pacific",
+ "Mountain", "Central", "Eastern"};
+
+ return zones[10 + getZoneOffset()];
+ }
+
+ public int getZoneOffset() {
+ return calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000);
+ }
+
+
+ public int getDSTOffset() {
+ return calendar.get(Calendar.DST_OFFSET)/(60*60*1000);
+ }
+
+
+ public int getAMPM() {
+ return calendar.get(Calendar.AM_PM);
+ }
+}
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/error/Smart.class b/tomcat-uid/webapps/examples/WEB-INF/classes/error/Smart.class
new file mode 100644
index 0000000..5445742
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/error/Smart.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/error/Smart.java b/tomcat-uid/webapps/examples/WEB-INF/classes/error/Smart.java
new file mode 100644
index 0000000..3af3a38
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/error/Smart.java
@@ -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.
+*/
+
+
+package error;
+
+public class Smart {
+
+ String name = "JSP";
+
+ public String getName () {
+ return name;
+ }
+
+ public void setName (String name) {
+ this.name = name;
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/examples/ExampleTagBase.class b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/ExampleTagBase.class
new file mode 100644
index 0000000..35edd28
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/ExampleTagBase.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/examples/ExampleTagBase.java b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/ExampleTagBase.java
new file mode 100644
index 0000000..13bcd16
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/ExampleTagBase.java
@@ -0,0 +1,67 @@
+/*
+* 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.
+*/
+package examples;
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+
+public abstract class ExampleTagBase extends BodyTagSupport {
+
+ public void setParent(Tag parent) {
+ this.parent = parent;
+ }
+
+ public void setBodyContent(BodyContent bodyOut) {
+ this.bodyOut = bodyOut;
+ }
+
+ public void setPageContext(PageContext pageContext) {
+ this.pageContext = pageContext;
+ }
+
+ public Tag getParent() {
+ return this.parent;
+ }
+
+ public int doStartTag() throws JspException {
+ return SKIP_BODY;
+ }
+
+ public int doEndTag() throws JspException {
+ return EVAL_PAGE;
+ }
+
+
+ // Default implementations for BodyTag methods as well
+ // just in case a tag decides to implement BodyTag.
+ public void doInitBody() throws JspException {
+ }
+
+ public int doAfterBody() throws JspException {
+ return SKIP_BODY;
+ }
+
+ public void release() {
+ bodyOut = null;
+ pageContext = null;
+ parent = null;
+ }
+
+ protected BodyContent bodyOut;
+ protected PageContext pageContext;
+ protected Tag parent;
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/examples/FooTag.class b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/FooTag.class
new file mode 100644
index 0000000..d60a6bd
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/FooTag.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/examples/FooTag.java b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/FooTag.java
new file mode 100644
index 0000000..4e11f30
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/FooTag.java
@@ -0,0 +1,80 @@
+/*
+* 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.
+*/
+package examples;
+
+import javax.servlet.jsp.*;
+import java.io.IOException;
+
+/**
+ * Example1: the simplest tag
+ * Collect attributes and call into some actions
+ *
+ * <foo att1="..." att2="...." att3="...." />
+ */
+
+public class FooTag
+ extends ExampleTagBase
+{
+ private String atts[] = new String[3];
+ int i = 0;
+
+ private final void setAtt(int index, String value) {
+ atts[index] = value;
+ }
+
+ public void setAtt1(String value) {
+ setAtt(0, value);
+ }
+
+ public void setAtt2(String value) {
+ setAtt(1, value);
+ }
+
+ public void setAtt3(String value) {
+ setAtt(2, value);
+ }
+
+ /**
+ * Process start tag
+ *
+ * @return EVAL_BODY_INCLUDE
+ */
+ public int doStartTag() throws JspException {
+ i = 0;
+ return EVAL_BODY_BUFFERED;
+ }
+
+ public void doInitBody() throws JspException {
+ pageContext.setAttribute("member", atts[i]);
+ i++;
+ }
+
+ public int doAfterBody() throws JspException {
+ try {
+ if (i == 3) {
+ bodyOut.writeOut(bodyOut.getEnclosingWriter());
+ return SKIP_BODY;
+ } else
+ pageContext.setAttribute("member", atts[i]);
+ i++;
+ return EVAL_BODY_BUFFERED;
+ } catch (IOException ex) {
+ throw new JspTagException(ex.toString());
+ }
+ }
+}
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/examples/FooTagExtraInfo.class b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/FooTagExtraInfo.class
new file mode 100644
index 0000000..5ca9cfb
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/FooTagExtraInfo.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/examples/FooTagExtraInfo.java b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/FooTagExtraInfo.java
new file mode 100644
index 0000000..99e5dfb
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/FooTagExtraInfo.java
@@ -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.
+*/
+package examples;
+
+import javax.servlet.jsp.tagext.*;
+
+public class FooTagExtraInfo extends TagExtraInfo {
+ public VariableInfo[] getVariableInfo(TagData data) {
+ return new VariableInfo[]
+ {
+ new VariableInfo("member",
+ "String",
+ true,
+ VariableInfo.NESTED)
+ };
+ }
+}
+
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/examples/LogTag.class b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/LogTag.class
new file mode 100644
index 0000000..92abeab
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/LogTag.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/examples/LogTag.java b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/LogTag.java
new file mode 100644
index 0000000..961cfc8
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/LogTag.java
@@ -0,0 +1,60 @@
+/*
+* 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.
+*/
+package examples;
+
+
+import javax.servlet.jsp.*;
+
+import java.io.IOException;
+
+/**
+ * Log the contents of the body. Could be used to handle errors etc.
+ */
+public class LogTag
+ extends ExampleTagBase
+{
+ boolean toBrowser = false;
+
+ public void setToBrowser(String value) {
+ if (value == null)
+ toBrowser = false;
+ else if (value.equalsIgnoreCase("true"))
+ toBrowser = true;
+ else
+ toBrowser = false;
+ }
+
+ public int doStartTag() throws JspException {
+ return EVAL_BODY_BUFFERED;
+ }
+
+ public int doAfterBody() throws JspException {
+ try {
+ String s = bodyOut.getString();
+ System.err.println(s);
+ if (toBrowser)
+ bodyOut.writeOut(bodyOut.getEnclosingWriter());
+ return SKIP_BODY;
+ } catch (IOException ex) {
+ throw new JspTagException(ex.toString());
+ }
+ }
+}
+
+
+
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/examples/ShowSource.class b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/ShowSource.class
new file mode 100644
index 0000000..c02b3ff
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/ShowSource.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/examples/ShowSource.java b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/ShowSource.java
new file mode 100644
index 0000000..8afbf09
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/examples/ShowSource.java
@@ -0,0 +1,71 @@
+/*
+* 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.
+*/
+package examples;
+
+
+import javax.servlet.jsp.*;
+import javax.servlet.jsp.tagext.*;
+
+import java.io.*;
+
+/**
+ * Display the sources of the JSP file.
+ */
+public class ShowSource
+ extends TagSupport
+{
+ String jspFile;
+
+ public void setJspFile(String jspFile) {
+ this.jspFile = jspFile;
+ }
+
+ public int doEndTag() throws JspException {
+ if ((jspFile.indexOf( ".." ) >= 0) ||
+ (jspFile.toUpperCase().indexOf("/WEB-INF/") != 0) ||
+ (jspFile.toUpperCase().indexOf("/META-INF/") != 0))
+ throw new JspTagException("Invalid JSP file " + jspFile);
+
+ InputStream in
+ = pageContext.getServletContext().getResourceAsStream(jspFile);
+
+ if (in == null)
+ throw new JspTagException("Unable to find JSP file: "+jspFile);
+
+ JspWriter out = pageContext.getOut();
+
+
+ try {
+ out.println("<body>");
+ out.println("<pre>");
+ for(int ch = in.read(); ch != -1; ch = in.read())
+ if (ch == '<')
+ out.print("<");
+ else
+ out.print((char) ch);
+ out.println("</pre>");
+ out.println("</body>");
+ } catch (IOException ex) {
+ throw new JspTagException("IOException: "+ex.toString());
+ }
+ return super.doEndTag();
+ }
+}
+
+
+
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/filters/ExampleFilter.class b/tomcat-uid/webapps/examples/WEB-INF/classes/filters/ExampleFilter.class
new file mode 100644
index 0000000..10a6710
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/filters/ExampleFilter.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/filters/ExampleFilter.java b/tomcat-uid/webapps/examples/WEB-INF/classes/filters/ExampleFilter.java
new file mode 100644
index 0000000..0601b87
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/filters/ExampleFilter.java
@@ -0,0 +1,137 @@
+/*
+* 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.
+*/
+
+package filters;
+
+
+import java.io.IOException;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+
+/**
+ * Example filter that can be attached to either an individual servlet
+ * or to a URL pattern. This filter performs the following functions:
+ * <ul>
+ * <li>Attaches itself as a request attribute, under the attribute name
+ * defined by the value of the <code>attribute</code> initialization
+ * parameter.</li>
+ * <li>Calculates the number of milliseconds required to perform the
+ * servlet processing required by this request, including any
+ * subsequently defined filters, and logs the result to the servlet
+ * context log for this application.
+ * </ul>
+ *
+ * @author Craig McClanahan
+ */
+public final class ExampleFilter implements Filter {
+
+
+ // ----------------------------------------------------- Instance Variables
+
+
+ /**
+ * The request attribute name under which we store a reference to ourself.
+ */
+ private String attribute = null;
+
+
+ /**
+ * The filter configuration object we are associated with. If this value
+ * is null, this filter instance is not currently configured.
+ */
+ private FilterConfig filterConfig = null;
+
+
+ // --------------------------------------------------------- Public Methods
+
+
+ /**
+ * Take this filter out of service.
+ */
+ public void destroy() {
+
+ this.attribute = null;
+ this.filterConfig = null;
+
+ }
+
+
+ /**
+ * Time the processing that is performed by all subsequent filters in the
+ * current filter stack, including the ultimately invoked servlet.
+ *
+ * @param request The servlet request we are processing
+ * @param result The servlet response we are creating
+ * @param chain The filter chain we are processing
+ *
+ * @exception IOException if an input/output error occurs
+ * @exception ServletException if a servlet error occurs
+ */
+ public void doFilter(ServletRequest request, ServletResponse response,
+ FilterChain chain)
+ throws IOException, ServletException {
+
+ // Store ourselves as a request attribute (if requested)
+ if (attribute != null)
+ request.setAttribute(attribute, this);
+
+ // Time and log the subsequent processing
+ long startTime = System.currentTimeMillis();
+ chain.doFilter(request, response);
+ long stopTime = System.currentTimeMillis();
+ filterConfig.getServletContext().log
+ (this.toString() + ": " + (stopTime - startTime) +
+ " milliseconds");
+
+ }
+
+
+ /**
+ * Place this filter into service.
+ *
+ * @param filterConfig The filter configuration object
+ */
+ public void init(FilterConfig filterConfig) throws ServletException {
+
+ this.filterConfig = filterConfig;
+ this.attribute = filterConfig.getInitParameter("attribute");
+
+ }
+
+
+ /**
+ * Return a String representation of this object.
+ */
+ public String toString() {
+
+ if (filterConfig == null)
+ return ("InvokerFilter()");
+ StringBuffer sb = new StringBuffer("InvokerFilter(");
+ sb.append(filterConfig);
+ sb.append(")");
+ return (sb.toString());
+
+ }
+
+
+}
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.class b/tomcat-uid/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.class
new file mode 100644
index 0000000..5b244bf
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.java b/tomcat-uid/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.java
new file mode 100644
index 0000000..7c45a40
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/filters/RequestDumperFilter.java
@@ -0,0 +1,198 @@
+/*
+* 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.
+*/
+
+
+package filters;
+
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.sql.Timestamp;
+import java.util.Enumeration;
+import java.util.Locale;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+
+
+/**
+ * Example filter that dumps interesting state information about a request
+ * to the associated servlet context log file, before allowing the servlet
+ * to process the request in the usual way. This can be installed as needed
+ * to assist in debugging problems.
+ *
+ * @author Craig McClanahan
+ */
+public final class RequestDumperFilter implements Filter {
+
+
+ // ----------------------------------------------------- Instance Variables
+
+
+ /**
+ * The filter configuration object we are associated with. If this value
+ * is null, this filter instance is not currently configured.
+ */
+ private FilterConfig filterConfig = null;
+
+
+ // --------------------------------------------------------- Public Methods
+
+
+ /**
+ * Take this filter out of service.
+ */
+ public void destroy() {
+
+ this.filterConfig = null;
+
+ }
+
+
+ /**
+ * Time the processing that is performed by all subsequent filters in the
+ * current filter stack, including the ultimately invoked servlet.
+ *
+ * @param request The servlet request we are processing
+ * @param result The servlet response we are creating
+ * @param chain The filter chain we are processing
+ *
+ * @exception IOException if an input/output error occurs
+ * @exception ServletException if a servlet error occurs
+ */
+ public void doFilter(ServletRequest request, ServletResponse response,
+ FilterChain chain)
+ throws IOException, ServletException {
+
+ if (filterConfig == null)
+ return;
+
+ // Render the generic servlet request properties
+ StringWriter sw = new StringWriter();
+ PrintWriter writer = new PrintWriter(sw);
+ writer.println("Request Received at " +
+ (new Timestamp(System.currentTimeMillis())));
+ writer.println(" characterEncoding=" + request.getCharacterEncoding());
+ writer.println(" contentLength=" + request.getContentLength());
+ writer.println(" contentType=" + request.getContentType());
+ writer.println(" locale=" + request.getLocale());
+ writer.print(" locales=");
+ Enumeration locales = request.getLocales();
+ boolean first = true;
+ while (locales.hasMoreElements()) {
+ Locale locale = (Locale) locales.nextElement();
+ if (first)
+ first = false;
+ else
+ writer.print(", ");
+ writer.print(locale.toString());
+ }
+ writer.println();
+ Enumeration names = request.getParameterNames();
+ while (names.hasMoreElements()) {
+ String name = (String) names.nextElement();
+ writer.print(" parameter=" + name + "=");
+ String values[] = request.getParameterValues(name);
+ for (int i = 0; i < values.length; i++) {
+ if (i > 0)
+ writer.print(", ");
+ writer.print(values[i]);
+ }
+ writer.println();
+ }
+ writer.println(" protocol=" + request.getProtocol());
+ writer.println(" remoteAddr=" + request.getRemoteAddr());
+ writer.println(" remoteHost=" + request.getRemoteHost());
+ writer.println(" scheme=" + request.getScheme());
+ writer.println(" serverName=" + request.getServerName());
+ writer.println(" serverPort=" + request.getServerPort());
+ writer.println(" isSecure=" + request.isSecure());
+
+ // Render the HTTP servlet request properties
+ if (request instanceof HttpServletRequest) {
+ writer.println("---------------------------------------------");
+ HttpServletRequest hrequest = (HttpServletRequest) request;
+ writer.println(" contextPath=" + hrequest.getContextPath());
+ Cookie cookies[] = hrequest.getCookies();
+ if (cookies == null)
+ cookies = new Cookie[0];
+ for (int i = 0; i < cookies.length; i++) {
+ writer.println(" cookie=" + cookies[i].getName() +
+ "=" + cookies[i].getValue());
+ }
+ names = hrequest.getHeaderNames();
+ while (names.hasMoreElements()) {
+ String name = (String) names.nextElement();
+ String value = hrequest.getHeader(name);
+ writer.println(" header=" + name + "=" + value);
+ }
+ writer.println(" method=" + hrequest.getMethod());
+ writer.println(" pathInfo=" + hrequest.getPathInfo());
+ writer.println(" queryString=" + hrequest.getQueryString());
+ writer.println(" remoteUser=" + hrequest.getRemoteUser());
+ writer.println("requestedSessionId=" +
+ hrequest.getRequestedSessionId());
+ writer.println(" requestURI=" + hrequest.getRequestURI());
+ writer.println(" servletPath=" + hrequest.getServletPath());
+ }
+ writer.println("=============================================");
+
+ // Log the resulting string
+ writer.flush();
+ filterConfig.getServletContext().log(sw.getBuffer().toString());
+
+ // Pass control on to the next filter
+ chain.doFilter(request, response);
+
+ }
+
+
+ /**
+ * Place this filter into service.
+ *
+ * @param filterConfig The filter configuration object
+ */
+ public void init(FilterConfig filterConfig) throws ServletException {
+
+ this.filterConfig = filterConfig;
+
+ }
+
+
+ /**
+ * Return a String representation of this object.
+ */
+ public String toString() {
+
+ if (filterConfig == null)
+ return ("RequestDumperFilter()");
+ StringBuffer sb = new StringBuffer("RequestDumperFilter(");
+ sb.append(filterConfig);
+ sb.append(")");
+ return (sb.toString());
+
+ }
+
+
+}
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.class b/tomcat-uid/webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.class
new file mode 100644
index 0000000..94be00b
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.java b/tomcat-uid/webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.java
new file mode 100644
index 0000000..9373222
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.java
@@ -0,0 +1,169 @@
+/*
+* 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.
+*/
+
+package filters;
+
+
+import java.io.IOException;
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+
+/**
+ * <p>Example filter that sets the character encoding to be used in parsing the
+ * incoming request, either unconditionally or only if the client did not
+ * specify a character encoding. Configuration of this filter is based on
+ * the following initialization parameters:</p>
+ * <ul>
+ * <li><strong>encoding</strong> - The character encoding to be configured
+ * for this request, either conditionally or unconditionally based on
+ * the <code>ignore</code> initialization parameter. This parameter
+ * is required, so there is no default.</li>
+ * <li><strong>ignore</strong> - If set to "true", any character encoding
+ * specified by the client is ignored, and the value returned by the
+ * <code>selectEncoding()</code> method is set. If set to "false,
+ * <code>selectEncoding()</code> is called <strong>only</strong> if the
+ * client has not already specified an encoding. By default, this
+ * parameter is set to "true".</li>
+ * </ul>
+ *
+ * <p>Although this filter can be used unchanged, it is also easy to
+ * subclass it and make the <code>selectEncoding()</code> method more
+ * intelligent about what encoding to choose, based on characteristics of
+ * the incoming request (such as the values of the <code>Accept-Language</code>
+ * and <code>User-Agent</code> headers, or a value stashed in the current
+ * user's session.</p>
+ *
+ * @author Craig McClanahan
+ */
+public class SetCharacterEncodingFilter implements Filter {
+
+
+ // ----------------------------------------------------- Instance Variables
+
+
+ /**
+ * The default character encoding to set for requests that pass through
+ * this filter.
+ */
+ protected String encoding = null;
+
+
+ /**
+ * The filter configuration object we are associated with. If this value
+ * is null, this filter instance is not currently configured.
+ */
+ protected FilterConfig filterConfig = null;
+
+
+ /**
+ * Should a character encoding specified by the client be ignored?
+ */
+ protected boolean ignore = true;
+
+
+ // --------------------------------------------------------- Public Methods
+
+
+ /**
+ * Take this filter out of service.
+ */
+ public void destroy() {
+
+ this.encoding = null;
+ this.filterConfig = null;
+
+ }
+
+
+ /**
+ * Select and set (if specified) the character encoding to be used to
+ * interpret request parameters for this request.
+ *
+ * @param request The servlet request we are processing
+ * @param result The servlet response we are creating
+ * @param chain The filter chain we are processing
+ *
+ * @exception IOException if an input/output error occurs
+ * @exception ServletException if a servlet error occurs
+ */
+ public void doFilter(ServletRequest request, ServletResponse response,
+ FilterChain chain)
+ throws IOException, ServletException {
+
+ // Conditionally select and set the character encoding to be used
+ if (ignore || (request.getCharacterEncoding() == null)) {
+ String encoding = selectEncoding(request);
+ if (encoding != null)
+ request.setCharacterEncoding(encoding);
+ }
+
+ // Pass control on to the next filter
+ chain.doFilter(request, response);
+
+ }
+
+
+ /**
+ * Place this filter into service.
+ *
+ * @param filterConfig The filter configuration object
+ */
+ public void init(FilterConfig filterConfig) throws ServletException {
+
+ this.filterConfig = filterConfig;
+ this.encoding = filterConfig.getInitParameter("encoding");
+ String value = filterConfig.getInitParameter("ignore");
+ if (value == null)
+ this.ignore = true;
+ else if (value.equalsIgnoreCase("true"))
+ this.ignore = true;
+ else if (value.equalsIgnoreCase("yes"))
+ this.ignore = true;
+ else
+ this.ignore = false;
+
+ }
+
+
+ // ------------------------------------------------------ Protected Methods
+
+
+ /**
+ * Select an appropriate character encoding to be used, based on the
+ * characteristics of the current request and/or filter initialization
+ * parameters. If no character encoding should be set, return
+ * <code>null</code>.
+ * <p>
+ * The default implementation unconditionally returns the value configured
+ * by the <strong>encoding</strong> initialization parameter for this
+ * filter.
+ *
+ * @param request The servlet request we are processing
+ */
+ protected String selectEncoding(ServletRequest request) {
+
+ return (this.encoding);
+
+ }
+
+
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/BookBean.class b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/BookBean.class
new file mode 100644
index 0000000..98b8c31
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/BookBean.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/BookBean.java b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/BookBean.java
new file mode 100644
index 0000000..5e5dec4
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/BookBean.java
@@ -0,0 +1,44 @@
+/*
+* 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.
+*/
+
+
+package jsp2.examples;
+
+public class BookBean {
+ private String title;
+ private String author;
+ private String isbn;
+
+ public BookBean( String title, String author, String isbn ) {
+ this.title = title;
+ this.author = author;
+ this.isbn = isbn;
+ }
+
+ public String getTitle() {
+ return this.title;
+ }
+
+ public String getAuthor() {
+ return this.author;
+ }
+
+ public String getIsbn() {
+ return this.isbn;
+ }
+
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/FooBean.class b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/FooBean.class
new file mode 100644
index 0000000..6605d19
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/FooBean.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/FooBean.java b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/FooBean.java
new file mode 100644
index 0000000..c7f4d39
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/FooBean.java
@@ -0,0 +1,36 @@
+/*
+* 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.
+*/
+
+
+package jsp2.examples;
+
+public class FooBean {
+ private String bar;
+
+ public FooBean() {
+ bar = "Initial value";
+ }
+
+ public String getBar() {
+ return this.bar;
+ }
+
+ public void setBar(String bar) {
+ this.bar = bar;
+ }
+
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/el/Functions.class b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/el/Functions.class
new file mode 100644
index 0000000..e0a869c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/el/Functions.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/el/Functions.java b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/el/Functions.java
new file mode 100644
index 0000000..c42c0f7
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/el/Functions.java
@@ -0,0 +1,43 @@
+/*
+* 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.
+*/
+package jsp2.examples.el;
+
+/**
+ * Defines the functions for the jsp2 example tag library.
+ *
+ * <p>Each function is defined as a static method.</p>
+ */
+public class Functions {
+ public static String reverse( String text ) {
+ return new StringBuffer( text ).reverse().toString();
+ }
+
+ public static int numVowels( String text ) {
+ String vowels = "aeiouAEIOU";
+ int result = 0;
+ for( int i = 0; i < text.length(); i++ ) {
+ if( vowels.indexOf( text.charAt( i ) ) != -1 ) {
+ result++;
+ }
+ }
+ return result;
+ }
+
+ public static String caps( String text ) {
+ return text.toUpperCase();
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/EchoAttributesTag.class b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/EchoAttributesTag.class
new file mode 100644
index 0000000..5cf67e4
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/EchoAttributesTag.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/EchoAttributesTag.java b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/EchoAttributesTag.java
new file mode 100644
index 0000000..c1a5f92
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/EchoAttributesTag.java
@@ -0,0 +1,54 @@
+/*
+* 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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import javax.servlet.jsp.tagext.DynamicAttributes;
+import java.util.ArrayList;
+import java.io.IOException;
+
+/**
+ * SimpleTag handler that echoes all its attributes
+ */
+public class EchoAttributesTag
+ extends SimpleTagSupport
+ implements DynamicAttributes
+{
+ private ArrayList keys = new ArrayList();
+ private ArrayList values = new ArrayList();
+
+ public void doTag() throws JspException, IOException {
+ JspWriter out = getJspContext().getOut();
+ for( int i = 0; i < keys.size(); i++ ) {
+ String key = (String)keys.get( i );
+ Object value = values.get( i );
+ out.println( "<li>" + key + " = " + value + "</li>" );
+ }
+ }
+
+ public void setDynamicAttribute( String uri, String localName,
+ Object value )
+ throws JspException
+ {
+ keys.add( localName );
+ values.add( value );
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/FindBookSimpleTag.class b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/FindBookSimpleTag.class
new file mode 100644
index 0000000..dd95ddb
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/FindBookSimpleTag.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/FindBookSimpleTag.java b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/FindBookSimpleTag.java
new file mode 100644
index 0000000..3d4357d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/FindBookSimpleTag.java
@@ -0,0 +1,44 @@
+/*
+* 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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import jsp2.examples.BookBean;
+
+/**
+ * SimpleTag handler that pretends to search for a book, and stores
+ * the result in a scoped variable.
+ */
+public class FindBookSimpleTag extends SimpleTagSupport {
+ private String var;
+
+ private static final String BOOK_TITLE = "The Lord of the Rings";
+ private static final String BOOK_AUTHOR = "J. R. R. Tolkein";
+ private static final String BOOK_ISBN = "0618002251";
+
+ public void doTag() throws JspException {
+ BookBean book = new BookBean( BOOK_TITLE, BOOK_AUTHOR, BOOK_ISBN );
+ getJspContext().setAttribute( this.var, book );
+ }
+
+ public void setVar( String var ) {
+ this.var = var;
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/HelloWorldSimpleTag.class b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/HelloWorldSimpleTag.class
new file mode 100644
index 0000000..ff44a1d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/HelloWorldSimpleTag.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/HelloWorldSimpleTag.java b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/HelloWorldSimpleTag.java
new file mode 100644
index 0000000..3085739
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/HelloWorldSimpleTag.java
@@ -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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import java.io.IOException;
+
+/**
+ * SimpleTag handler that prints "Hello, world!"
+ */
+public class HelloWorldSimpleTag extends SimpleTagSupport {
+ public void doTag() throws JspException, IOException {
+ getJspContext().getOut().write( "Hello, world!" );
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/RepeatSimpleTag.class b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/RepeatSimpleTag.class
new file mode 100644
index 0000000..55e4835
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/RepeatSimpleTag.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/RepeatSimpleTag.java b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/RepeatSimpleTag.java
new file mode 100644
index 0000000..9903a21
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/RepeatSimpleTag.java
@@ -0,0 +1,42 @@
+/*
+* 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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import java.io.IOException;
+
+/**
+ * SimpleTag handler that accepts a num attribute and
+ * invokes its body 'num' times.
+ */
+public class RepeatSimpleTag extends SimpleTagSupport {
+ private int num;
+
+ public void doTag() throws JspException, IOException {
+ for (int i=0; i<num; i++) {
+ getJspContext().setAttribute("count", String.valueOf( i + 1 ) );
+ getJspBody().invoke(null);
+ }
+ }
+
+ public void setNum(int num) {
+ this.num = num;
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/ShuffleSimpleTag.class b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/ShuffleSimpleTag.class
new file mode 100644
index 0000000..759c5ac
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/ShuffleSimpleTag.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/ShuffleSimpleTag.java b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/ShuffleSimpleTag.java
new file mode 100644
index 0000000..64c5b72
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/ShuffleSimpleTag.java
@@ -0,0 +1,81 @@
+/*
+* 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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.JspFragment;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import java.io.IOException;
+
+/**
+ * SimpleTag handler that accepts takes three attributes of type
+ * JspFragment and invokes then in a random order.
+ */
+public class ShuffleSimpleTag extends SimpleTagSupport {
+ private JspFragment fragment1;
+ private JspFragment fragment2;
+ private JspFragment fragment3;
+
+ public void doTag() throws JspException, IOException {
+ switch( (int)(Math.random() * 6) ) {
+ case 0:
+ fragment1.invoke( null );
+ fragment2.invoke( null );
+ fragment3.invoke( null );
+ break;
+ case 1:
+ fragment1.invoke( null );
+ fragment3.invoke( null );
+ fragment2.invoke( null );
+ break;
+ case 2:
+ fragment2.invoke( null );
+ fragment1.invoke( null );
+ fragment3.invoke( null );
+ break;
+ case 3:
+ fragment2.invoke( null );
+ fragment3.invoke( null );
+ fragment1.invoke( null );
+ break;
+ case 4:
+ fragment3.invoke( null );
+ fragment1.invoke( null );
+ fragment2.invoke( null );
+ break;
+ case 5:
+ fragment3.invoke( null );
+ fragment2.invoke( null );
+ fragment1.invoke( null );
+ break;
+ }
+ }
+
+ public void setFragment1( JspFragment fragment1 ) {
+ this.fragment1 = fragment1;
+ }
+
+ public void setFragment2( JspFragment fragment2 ) {
+ this.fragment2 = fragment2;
+ }
+
+ public void setFragment3( JspFragment fragment3 ) {
+ this.fragment3 = fragment3;
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/TileSimpleTag.class b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/TileSimpleTag.class
new file mode 100644
index 0000000..c33cccc
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/TileSimpleTag.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/TileSimpleTag.java b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/TileSimpleTag.java
new file mode 100644
index 0000000..4f37e48
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/jsp2/examples/simpletag/TileSimpleTag.java
@@ -0,0 +1,46 @@
+/*
+* 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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import java.io.IOException;
+
+/**
+ * Displays a tile as a single cell in a table.
+ */
+public class TileSimpleTag extends SimpleTagSupport {
+ private String color;
+ private String label;
+
+ public void doTag() throws JspException, IOException {
+ getJspContext().getOut().write(
+ "<td width=\"32\" height=\"32\" bgcolor=\"" + this.color +
+ "\"><font color=\"#ffffff\"><center>" + this.label +
+ "</center></font></td>" );
+ }
+
+ public void setColor( String color ) {
+ this.color = color;
+ }
+
+ public void setLabel( String label ) {
+ this.label = label;
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/listeners/ContextListener.class b/tomcat-uid/webapps/examples/WEB-INF/classes/listeners/ContextListener.class
new file mode 100644
index 0000000..43f66ff
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/listeners/ContextListener.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/listeners/ContextListener.java b/tomcat-uid/webapps/examples/WEB-INF/classes/listeners/ContextListener.java
new file mode 100644
index 0000000..4702546
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/listeners/ContextListener.java
@@ -0,0 +1,134 @@
+/*
+* 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.
+*/
+
+package listeners;
+
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextAttributeEvent;
+import javax.servlet.ServletContextAttributeListener;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+
+/**
+ * Example listener for context-related application events, which were
+ * introduced in the 2.3 version of the Servlet API. This listener
+ * merely documents the occurrence of such events in the application log
+ * associated with our servlet context.
+ *
+ * @author Craig R. McClanahan
+ */
+public final class ContextListener
+ implements ServletContextAttributeListener, ServletContextListener {
+
+
+ // ----------------------------------------------------- Instance Variables
+
+
+ /**
+ * The servlet context with which we are associated.
+ */
+ private ServletContext context = null;
+
+
+ // --------------------------------------------------------- Public Methods
+
+
+ /**
+ * Record the fact that a servlet context attribute was added.
+ *
+ * @param event The servlet context attribute event
+ */
+ public void attributeAdded(ServletContextAttributeEvent event) {
+
+ log("attributeAdded('" + event.getName() + "', '" +
+ event.getValue() + "')");
+
+ }
+
+
+ /**
+ * Record the fact that a servlet context attribute was removed.
+ *
+ * @param event The servlet context attribute event
+ */
+ public void attributeRemoved(ServletContextAttributeEvent event) {
+
+ log("attributeRemoved('" + event.getName() + "', '" +
+ event.getValue() + "')");
+
+ }
+
+
+ /**
+ * Record the fact that a servlet context attribute was replaced.
+ *
+ * @param event The servlet context attribute event
+ */
+ public void attributeReplaced(ServletContextAttributeEvent event) {
+
+ log("attributeReplaced('" + event.getName() + "', '" +
+ event.getValue() + "')");
+
+ }
+
+
+ /**
+ * Record the fact that this web application has been destroyed.
+ *
+ * @param event The servlet context event
+ */
+ public void contextDestroyed(ServletContextEvent event) {
+
+ log("contextDestroyed()");
+ this.context = null;
+
+ }
+
+
+ /**
+ * Record the fact that this web application has been initialized.
+ *
+ * @param event The servlet context event
+ */
+ public void contextInitialized(ServletContextEvent event) {
+
+ this.context = event.getServletContext();
+ log("contextInitialized()");
+
+ }
+
+
+ // -------------------------------------------------------- Private Methods
+
+
+ /**
+ * Log a message to the servlet context application log.
+ *
+ * @param message Message to be logged
+ */
+ private void log(String message) {
+
+ if (context != null)
+ context.log("ContextListener: " + message);
+ else
+ System.out.println("ContextListener: " + message);
+
+ }
+
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/listeners/SessionListener.class b/tomcat-uid/webapps/examples/WEB-INF/classes/listeners/SessionListener.class
new file mode 100644
index 0000000..8afca5e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/listeners/SessionListener.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/listeners/SessionListener.java b/tomcat-uid/webapps/examples/WEB-INF/classes/listeners/SessionListener.java
new file mode 100644
index 0000000..efac784
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/listeners/SessionListener.java
@@ -0,0 +1,161 @@
+/*
+* 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.
+*/
+
+package listeners;
+
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.http.HttpSessionAttributeListener;
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+
+/**
+ * Example listener for context-related application events, which were
+ * introduced in the 2.3 version of the Servlet API. This listener
+ * merely documents the occurrence of such events in the application log
+ * associated with our servlet context.
+ *
+ * @author Craig R. McClanahan
+ */
+public final class SessionListener
+ implements ServletContextListener,
+ HttpSessionAttributeListener, HttpSessionListener {
+
+
+ // ----------------------------------------------------- Instance Variables
+
+
+ /**
+ * The servlet context with which we are associated.
+ */
+ private ServletContext context = null;
+
+
+ // --------------------------------------------------------- Public Methods
+
+
+ /**
+ * Record the fact that a servlet context attribute was added.
+ *
+ * @param event The session attribute event
+ */
+ public void attributeAdded(HttpSessionBindingEvent event) {
+
+ log("attributeAdded('" + event.getSession().getId() + "', '" +
+ event.getName() + "', '" + event.getValue() + "')");
+
+ }
+
+
+ /**
+ * Record the fact that a servlet context attribute was removed.
+ *
+ * @param event The session attribute event
+ */
+ public void attributeRemoved(HttpSessionBindingEvent event) {
+
+ log("attributeRemoved('" + event.getSession().getId() + "', '" +
+ event.getName() + "', '" + event.getValue() + "')");
+
+ }
+
+
+ /**
+ * Record the fact that a servlet context attribute was replaced.
+ *
+ * @param event The session attribute event
+ */
+ public void attributeReplaced(HttpSessionBindingEvent event) {
+
+ log("attributeReplaced('" + event.getSession().getId() + "', '" +
+ event.getName() + "', '" + event.getValue() + "')");
+
+ }
+
+
+ /**
+ * Record the fact that this web application has been destroyed.
+ *
+ * @param event The servlet context event
+ */
+ public void contextDestroyed(ServletContextEvent event) {
+
+ log("contextDestroyed()");
+ this.context = null;
+
+ }
+
+
+ /**
+ * Record the fact that this web application has been initialized.
+ *
+ * @param event The servlet context event
+ */
+ public void contextInitialized(ServletContextEvent event) {
+
+ this.context = event.getServletContext();
+ log("contextInitialized()");
+
+ }
+
+
+ /**
+ * Record the fact that a session has been created.
+ *
+ * @param event The session event
+ */
+ public void sessionCreated(HttpSessionEvent event) {
+
+ log("sessionCreated('" + event.getSession().getId() + "')");
+
+ }
+
+
+ /**
+ * Record the fact that a session has been destroyed.
+ *
+ * @param event The session event
+ */
+ public void sessionDestroyed(HttpSessionEvent event) {
+
+ log("sessionDestroyed('" + event.getSession().getId() + "')");
+
+ }
+
+
+ // -------------------------------------------------------- Private Methods
+
+
+ /**
+ * Log a message to the servlet context application log.
+ *
+ * @param message Message to be logged
+ */
+ private void log(String message) {
+
+ if (context != null)
+ context.log("SessionListener: " + message);
+ else
+ System.out.println("SessionListener: " + message);
+
+ }
+
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/num/NumberGuessBean.class b/tomcat-uid/webapps/examples/WEB-INF/classes/num/NumberGuessBean.class
new file mode 100644
index 0000000..51e5b62
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/num/NumberGuessBean.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/num/NumberGuessBean.java b/tomcat-uid/webapps/examples/WEB-INF/classes/num/NumberGuessBean.java
new file mode 100644
index 0000000..7eed08e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/num/NumberGuessBean.java
@@ -0,0 +1,79 @@
+/*
+* 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.
+*/
+
+/*
+ * Originally written by Jason Hunter, http://www.servlets.com.
+ */
+
+package num;
+
+import java.util.*;
+
+public class NumberGuessBean {
+
+ int answer;
+ boolean success;
+ String hint;
+ int numGuesses;
+
+ public NumberGuessBean() {
+ reset();
+ }
+
+ public void setGuess(String guess) {
+ numGuesses++;
+
+ int g;
+ try {
+ g = Integer.parseInt(guess);
+ }
+ catch (NumberFormatException e) {
+ g = -1;
+ }
+
+ if (g == answer) {
+ success = true;
+ }
+ else if (g == -1) {
+ hint = "a number next time";
+ }
+ else if (g < answer) {
+ hint = "higher";
+ }
+ else if (g > answer) {
+ hint = "lower";
+ }
+ }
+
+ public boolean getSuccess() {
+ return success;
+ }
+
+ public String getHint() {
+ return "" + hint;
+ }
+
+ public int getNumGuesses() {
+ return numGuesses;
+ }
+
+ public void reset() {
+ answer = Math.abs(new Random().nextInt() % 100) + 1;
+ success = false;
+ numGuesses = 0;
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/servletToJsp.class b/tomcat-uid/webapps/examples/WEB-INF/classes/servletToJsp.class
new file mode 100644
index 0000000..c95143b
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/servletToJsp.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/servletToJsp.java b/tomcat-uid/webapps/examples/WEB-INF/classes/servletToJsp.java
new file mode 100644
index 0000000..cfd198e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/servletToJsp.java
@@ -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.
+*/
+import javax.servlet.http.*;
+
+public class servletToJsp extends HttpServlet {
+
+ public void doGet (HttpServletRequest request,
+ HttpServletResponse response) {
+
+ try {
+ // Set the attribute and Forward to hello.jsp
+ request.setAttribute ("servletName", "servletToJsp");
+ getServletConfig().getServletContext().getRequestDispatcher("/jsp/jsptoserv/hello.jsp").forward(request, response);
+ } catch (Exception ex) {
+ ex.printStackTrace ();
+ }
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/sessions/DummyCart.class b/tomcat-uid/webapps/examples/WEB-INF/classes/sessions/DummyCart.class
new file mode 100644
index 0000000..5518952
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/sessions/DummyCart.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/sessions/DummyCart.java b/tomcat-uid/webapps/examples/WEB-INF/classes/sessions/DummyCart.java
new file mode 100644
index 0000000..f0597e7
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/sessions/DummyCart.java
@@ -0,0 +1,65 @@
+/*
+* 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.
+*/
+package sessions;
+
+import java.util.Vector;
+
+public class DummyCart {
+ Vector<String> v = new Vector<String>();
+ String submit = null;
+ String item = null;
+
+ private void addItem(String name) {
+ v.addElement(name);
+ }
+
+ private void removeItem(String name) {
+ v.removeElement(name);
+ }
+
+ public void setItem(String name) {
+ item = name;
+ }
+
+ public void setSubmit(String s) {
+ submit = s;
+ }
+
+ public String[] getItems() {
+ String[] s = new String[v.size()];
+ v.copyInto(s);
+ return s;
+ }
+
+ public void processRequest() {
+ // null value for submit - user hit enter instead of clicking on
+ // "add" or "remove"
+ if (submit == null || submit.equals("add"))
+ addItem(item);
+ else if (submit.equals("remove"))
+ removeItem(item);
+
+ // reset at the end of the request
+ reset();
+ }
+
+ // reset
+ private void reset() {
+ submit = null;
+ item = null;
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/util/HTMLFilter.class b/tomcat-uid/webapps/examples/WEB-INF/classes/util/HTMLFilter.class
new file mode 100644
index 0000000..7555aa0
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/util/HTMLFilter.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/util/HTMLFilter.java b/tomcat-uid/webapps/examples/WEB-INF/classes/util/HTMLFilter.java
new file mode 100644
index 0000000..3d85e81
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/util/HTMLFilter.java
@@ -0,0 +1,67 @@
+/*
+* 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.
+*/
+package util;
+
+/**
+ * HTML filter utility.
+ *
+ * @author Craig R. McClanahan
+ * @author Tim Tye
+ */
+public final class HTMLFilter {
+
+
+ /**
+ * Filter the specified message string for characters that are sensitive
+ * in HTML. This avoids potential attacks caused by including JavaScript
+ * codes in the request URL that is often reported in error messages.
+ *
+ * @param message The message string to be filtered
+ */
+ public static String filter(String message) {
+
+ if (message == null)
+ return (null);
+
+ char content[] = new char[message.length()];
+ message.getChars(0, message.length(), content, 0);
+ StringBuffer result = new StringBuffer(content.length + 50);
+ for (int i = 0; i < content.length; i++) {
+ switch (content[i]) {
+ case '<':
+ result.append("<");
+ break;
+ case '>':
+ result.append(">");
+ break;
+ case '&':
+ result.append("&");
+ break;
+ case '"':
+ result.append(""");
+ break;
+ default:
+ result.append(content[i]);
+ }
+ }
+ return (result.toString());
+
+ }
+
+
+}
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/validators/DebugValidator.class b/tomcat-uid/webapps/examples/WEB-INF/classes/validators/DebugValidator.class
new file mode 100644
index 0000000..90b65ce
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/validators/DebugValidator.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/classes/validators/DebugValidator.java b/tomcat-uid/webapps/examples/WEB-INF/classes/validators/DebugValidator.java
new file mode 100644
index 0000000..1ddffc4
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/classes/validators/DebugValidator.java
@@ -0,0 +1,82 @@
+/*
+* 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.
+*/
+
+
+package validators;
+
+
+import java.io.InputStream;
+import java.io.IOException;
+import javax.servlet.jsp.tagext.PageData;
+import javax.servlet.jsp.tagext.TagLibraryValidator;
+import javax.servlet.jsp.tagext.ValidationMessage;
+
+
+/**
+ * Example tag library validator that simply dumps the XML version of each
+ * page to standard output (which will typically be sent to the file
+ * <code>$CATALINA_HOME/logs/catalina.out</code>). To utilize it, simply
+ * include a <code>taglib</code> directive for this tag library at the top
+ * of your JSP page.
+ *
+ * @author Craig McClanahan
+ */
+public class DebugValidator extends TagLibraryValidator {
+
+
+ // ----------------------------------------------------- Instance Variables
+
+
+ // --------------------------------------------------------- Public Methods
+
+
+ /**
+ * Validate a JSP page. This will get invoked once per directive in the
+ * JSP page. This method will return <code>null</code> if the page is
+ * valid; otherwise the method should return an array of
+ * <code>ValidationMessage</code> objects. An array of length zero is
+ * also interpreted as no errors.
+ *
+ * @param prefix The value of the prefix argument in this directive
+ * @param uri The value of the URI argument in this directive
+ * @param page The page data for this page
+ */
+ public ValidationMessage[] validate(String prefix, String uri,
+ PageData page) {
+
+ System.out.println("---------- Prefix=" + prefix + " URI=" + uri +
+ "----------");
+
+ InputStream is = page.getInputStream();
+ while (true) {
+ try {
+ int ch = is.read();
+ if (ch < 0)
+ break;
+ System.out.print((char) ch);
+ } catch (IOException e) {
+ break;
+ }
+ }
+ System.out.println();
+ System.out.println("-----------------------------------------------");
+ return (null);
+
+ }
+
+
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/jsp/applet/Clock2.java b/tomcat-uid/webapps/examples/WEB-INF/jsp/applet/Clock2.java
new file mode 100644
index 0000000..16a8790
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/jsp/applet/Clock2.java
@@ -0,0 +1,212 @@
+/*
+* 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.
+*/
+import java.util.*;
+import java.awt.*;
+import java.applet.*;
+import java.text.*;
+
+/**
+ * Time!
+ *
+ * @author Rachel Gollub
+ */
+
+public class Clock2 extends Applet implements Runnable {
+ Thread timer; // The thread that displays clock
+ int lastxs, lastys, lastxm,
+ lastym, lastxh, lastyh; // Dimensions used to draw hands
+ SimpleDateFormat formatter; // Formats the date displayed
+ String lastdate; // String to hold date displayed
+ Font clockFaceFont; // Font for number display on clock
+ Date currentDate; // Used to get date to display
+ Color handColor; // Color of main hands and dial
+ Color numberColor; // Color of second hand and numbers
+
+ public void init() {
+ int x,y;
+ lastxs = lastys = lastxm = lastym = lastxh = lastyh = 0;
+ formatter = new SimpleDateFormat ("EEE MMM dd hh:mm:ss yyyy", Locale.getDefault());
+ currentDate = new Date();
+ lastdate = formatter.format(currentDate);
+ clockFaceFont = new Font("Serif", Font.PLAIN, 14);
+ handColor = Color.blue;
+ numberColor = Color.darkGray;
+
+ try {
+ setBackground(new Color(Integer.parseInt(getParameter("bgcolor"),16)));
+ } catch (Exception E) { }
+ try {
+ handColor = new Color(Integer.parseInt(getParameter("fgcolor1"),16));
+ } catch (Exception E) { }
+ try {
+ numberColor = new Color(Integer.parseInt(getParameter("fgcolor2"),16));
+ } catch (Exception E) { }
+ resize(300,300); // Set clock window size
+ }
+
+ // Plotpoints allows calculation to only cover 45 degrees of the circle,
+ // and then mirror
+ public void plotpoints(int x0, int y0, int x, int y, Graphics g) {
+ g.drawLine(x0+x,y0+y,x0+x,y0+y);
+ g.drawLine(x0+y,y0+x,x0+y,y0+x);
+ g.drawLine(x0+y,y0-x,x0+y,y0-x);
+ g.drawLine(x0+x,y0-y,x0+x,y0-y);
+ g.drawLine(x0-x,y0-y,x0-x,y0-y);
+ g.drawLine(x0-y,y0-x,x0-y,y0-x);
+ g.drawLine(x0-y,y0+x,x0-y,y0+x);
+ g.drawLine(x0-x,y0+y,x0-x,y0+y);
+ }
+
+ // Circle is just Bresenham's algorithm for a scan converted circle
+ public void circle(int x0, int y0, int r, Graphics g) {
+ int x,y;
+ float d;
+ x=0;
+ y=r;
+ d=5/4-r;
+ plotpoints(x0,y0,x,y,g);
+
+ while (y>x){
+ if (d<0) {
+ d=d+2*x+3;
+ x++;
+ }
+ else {
+ d=d+2*(x-y)+5;
+ x++;
+ y--;
+ }
+ plotpoints(x0,y0,x,y,g);
+ }
+ }
+
+ // Paint is the main part of the program
+ public void paint(Graphics g) {
+ int xh, yh, xm, ym, xs, ys, s = 0, m = 10, h = 10, xcenter, ycenter;
+ String today;
+
+ currentDate = new Date();
+ SimpleDateFormat formatter = new SimpleDateFormat("s",Locale.getDefault());
+ try {
+ s = Integer.parseInt(formatter.format(currentDate));
+ } catch (NumberFormatException n) {
+ s = 0;
+ }
+ formatter.applyPattern("m");
+ try {
+ m = Integer.parseInt(formatter.format(currentDate));
+ } catch (NumberFormatException n) {
+ m = 10;
+ }
+ formatter.applyPattern("h");
+ try {
+ h = Integer.parseInt(formatter.format(currentDate));
+ } catch (NumberFormatException n) {
+ h = 10;
+ }
+ formatter.applyPattern("EEE MMM dd HH:mm:ss yyyy");
+ today = formatter.format(currentDate);
+ xcenter=80;
+ ycenter=55;
+
+ // a= s* pi/2 - pi/2 (to switch 0,0 from 3:00 to 12:00)
+ // x = r(cos a) + xcenter, y = r(sin a) + ycenter
+
+ xs = (int)(Math.cos(s * 3.14f/30 - 3.14f/2) * 45 + xcenter);
+ ys = (int)(Math.sin(s * 3.14f/30 - 3.14f/2) * 45 + ycenter);
+ xm = (int)(Math.cos(m * 3.14f/30 - 3.14f/2) * 40 + xcenter);
+ ym = (int)(Math.sin(m * 3.14f/30 - 3.14f/2) * 40 + ycenter);
+ xh = (int)(Math.cos((h*30 + m/2) * 3.14f/180 - 3.14f/2) * 30 + xcenter);
+ yh = (int)(Math.sin((h*30 + m/2) * 3.14f/180 - 3.14f/2) * 30 + ycenter);
+
+ // Draw the circle and numbers
+
+ g.setFont(clockFaceFont);
+ g.setColor(handColor);
+ circle(xcenter,ycenter,50,g);
+ g.setColor(numberColor);
+ g.drawString("9",xcenter-45,ycenter+3);
+ g.drawString("3",xcenter+40,ycenter+3);
+ g.drawString("12",xcenter-5,ycenter-37);
+ g.drawString("6",xcenter-3,ycenter+45);
+
+ // Erase if necessary, and redraw
+
+ g.setColor(getBackground());
+ if (xs != lastxs || ys != lastys) {
+ g.drawLine(xcenter, ycenter, lastxs, lastys);
+ g.drawString(lastdate, 5, 125);
+ }
+ if (xm != lastxm || ym != lastym) {
+ g.drawLine(xcenter, ycenter-1, lastxm, lastym);
+ g.drawLine(xcenter-1, ycenter, lastxm, lastym); }
+ if (xh != lastxh || yh != lastyh) {
+ g.drawLine(xcenter, ycenter-1, lastxh, lastyh);
+ g.drawLine(xcenter-1, ycenter, lastxh, lastyh); }
+ g.setColor(numberColor);
+ g.drawString("", 5, 125);
+ g.drawString(today, 5, 125);
+ g.drawLine(xcenter, ycenter, xs, ys);
+ g.setColor(handColor);
+ g.drawLine(xcenter, ycenter-1, xm, ym);
+ g.drawLine(xcenter-1, ycenter, xm, ym);
+ g.drawLine(xcenter, ycenter-1, xh, yh);
+ g.drawLine(xcenter-1, ycenter, xh, yh);
+ lastxs=xs; lastys=ys;
+ lastxm=xm; lastym=ym;
+ lastxh=xh; lastyh=yh;
+ lastdate = today;
+ currentDate=null;
+ }
+
+ public void start() {
+ timer = new Thread(this);
+ timer.start();
+ }
+
+ public void stop() {
+ timer = null;
+ }
+
+ public void run() {
+ Thread me = Thread.currentThread();
+ while (timer == me) {
+ try {
+ Thread.currentThread().sleep(100);
+ } catch (InterruptedException e) {
+ }
+ repaint();
+ }
+ }
+
+ public void update(Graphics g) {
+ paint(g);
+ }
+
+ public String getAppletInfo() {
+ return "Title: A Clock \nAuthor: Rachel Gollub, 1995 \nAn analog clock.";
+ }
+
+ public String[][] getParameterInfo() {
+ String[][] info = {
+ {"bgcolor", "hexadecimal RGB number", "The background color. Default is the color of your browser."},
+ {"fgcolor1", "hexadecimal RGB number", "The color of the hands and dial. Default is blue."},
+ {"fgcolor2", "hexadecimal RGB number", "The color of the seconds hand and numbers. Default is dark gray."}
+ };
+ return info;
+ }
+}
diff --git a/tomcat-uid/webapps/examples/WEB-INF/jsp/debug-taglib.tld b/tomcat-uid/webapps/examples/WEB-INF/jsp/debug-taglib.tld
new file mode 100644
index 0000000..8deea3e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/jsp/debug-taglib.tld
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ 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 taglib
+ PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+ "http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd">
+
+<!-- a tag library descriptor -->
+
+<taglib>
+ <tlib-version>1.0</tlib-version>
+ <jsp-version>1.2</jsp-version>
+ <short-name>debug</short-name>
+ <uri>http://tomcat.apache.org/debug-taglib</uri>
+ <description>
+ This tag library defines no tags. Instead, its purpose is encapsulated
+ in the TagLibraryValidator implementation that simply outputs the XML
+ version of a JSP page to standard output, whenever this tag library is
+ referenced in a "taglib" directive in a JSP page.
+ </description>
+ <validator>
+ <validator-class>validators.DebugValidator</validator-class>
+ </validator>
+
+ <!-- This is a dummy tag solely to satisfy DTD requirements -->
+ <tag>
+ <name>log</name>
+ <tag-class>examples.LogTag</tag-class>
+ <body-content>TAGDEPENDENT</body-content>
+ <description>
+ Perform a server side action; Log the message.
+ </description>
+ <attribute>
+ <name>toBrowser</name>
+ <required>false</required>
+ </attribute>
+ </tag>
+
+
+</taglib>
diff --git a/tomcat-uid/webapps/examples/WEB-INF/jsp/example-taglib.tld b/tomcat-uid/webapps/examples/WEB-INF/jsp/example-taglib.tld
new file mode 100644
index 0000000..0739c5c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/jsp/example-taglib.tld
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+ 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 taglib
+ PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
+ "http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd">
+
+<taglib>
+
+ <tlib-version>1.0</tlib-version>
+ <jsp-version>1.2</jsp-version>
+ <short-name>simple</short-name>
+ <uri>http://tomcat.apache.org/example-taglib</uri>
+ <description>
+ A simple tab library for the examples
+ </description>
+
+ <tag>
+ <name>ShowSource</name>
+ <tag-class>examples.ShowSource</tag-class>
+ <description> Display JSP sources </description>
+ <attribute>
+ <name>jspFile</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <!-- A simple Tag -->
+ <!-- foo tag -->
+ <tag>
+ <name>foo</name>
+ <tag-class>examples.FooTag</tag-class>
+ <tei-class>examples.FooTagExtraInfo</tei-class>
+ <body-content>JSP</body-content>
+ <description>
+ Perform a server side action; uses 3 mandatory attributes
+ </description>
+
+ <attribute>
+ <name>att1</name>
+ <required>true</required>
+ </attribute>
+ <attribute>
+ <name>att2</name>
+ <required>true</required>
+ </attribute>
+ <attribute>
+ <name>att3</name>
+ <required>true</required>
+ </attribute>
+ </tag>
+
+ <!-- Another simple tag -->
+ <!-- log tag -->
+ <tag>
+ <name>log</name>
+ <tag-class>examples.LogTag</tag-class>
+ <body-content>TAGDEPENDENT</body-content>
+ <description>
+ Perform a server side action; Log the message.
+ </description>
+ <attribute>
+ <name>toBrowser</name>
+ <required>false</required>
+ </attribute>
+ </tag>
+
+</taglib>
diff --git a/tomcat-uid/webapps/examples/WEB-INF/jsp2/jsp2-example-taglib.tld b/tomcat-uid/webapps/examples/WEB-INF/jsp2/jsp2-example-taglib.tld
new file mode 100644
index 0000000..39f56f5
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/jsp2/jsp2-example-taglib.tld
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ 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.
+-->
+
+<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
+ version="2.0">
+ <description>A tag library exercising SimpleTag handlers.</description>
+ <tlib-version>1.0</tlib-version>
+ <short-name>SimpleTagLibrary</short-name>
+ <uri>/SimpleTagLibrary</uri>
+ <tag>
+ <description>Outputs Hello, World</description>
+ <name>helloWorld</name>
+ <tag-class>jsp2.examples.simpletag.HelloWorldSimpleTag</tag-class>
+ <body-content>empty</body-content>
+ </tag>
+ <tag>
+ <description>Repeats the body of the tag 'num' times</description>
+ <name>repeat</name>
+ <tag-class>jsp2.examples.simpletag.RepeatSimpleTag</tag-class>
+ <body-content>scriptless</body-content>
+ <variable>
+ <description>Current invocation count (1 to num)</description>
+ <name-given>count</name-given>
+ </variable>
+ <attribute>
+ <name>num</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+ <tag>
+ <description>Populates the page context with a BookBean</description>
+ <name>findBook</name>
+ <tag-class>jsp2.examples.simpletag.FindBookSimpleTag</tag-class>
+ <body-content>empty</body-content>
+ <attribute>
+ <name>var</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+ <tag>
+ <description>
+ Takes 3 fragments and invokes them in a random order
+ </description>
+ <name>shuffle</name>
+ <tag-class>jsp2.examples.simpletag.ShuffleSimpleTag</tag-class>
+ <body-content>empty</body-content>
+ <attribute>
+ <name>fragment1</name>
+ <required>true</required>
+ <fragment>true</fragment>
+ </attribute>
+ <attribute>
+ <name>fragment2</name>
+ <required>true</required>
+ <fragment>true</fragment>
+ </attribute>
+ <attribute>
+ <name>fragment3</name>
+ <required>true</required>
+ <fragment>true</fragment>
+ </attribute>
+ </tag>
+ <tag>
+ <description>Outputs a colored tile</description>
+ <name>tile</name>
+ <tag-class>jsp2.examples.simpletag.TileSimpleTag</tag-class>
+ <body-content>empty</body-content>
+ <attribute>
+ <name>color</name>
+ <required>true</required>
+ </attribute>
+ <attribute>
+ <name>label</name>
+ <required>true</required>
+ </attribute>
+ </tag>
+ <tag>
+ <description>
+ Tag that echoes all its attributes and body content
+ </description>
+ <name>echoAttributes</name>
+ <tag-class>jsp2.examples.simpletag.EchoAttributesTag</tag-class>
+ <body-content>empty</body-content>
+ <dynamic-attributes>true</dynamic-attributes>
+ </tag>
+ <function>
+ <description>Reverses the characters in the given String</description>
+ <name>reverse</name>
+ <function-class>jsp2.examples.el.Functions</function-class>
+ <function-signature>java.lang.String reverse( java.lang.String )</function-signature>
+ </function>
+ <function>
+ <description>Counts the number of vowels (a,e,i,o,u) in the given String</description>
+ <name>countVowels</name>
+ <function-class>jsp2.examples.el.Functions</function-class>
+ <function-signature>java.lang.String numVowels( java.lang.String )</function-signature>
+ </function>
+ <function>
+ <description>Converts the string to all caps</description>
+ <name>caps</name>
+ <function-class>jsp2.examples.el.Functions</function-class>
+ <function-signature>java.lang.String caps( java.lang.String )</function-signature>
+ </function>
+</taglib>
+
diff --git a/tomcat-uid/webapps/examples/WEB-INF/lib/jstl.jar b/tomcat-uid/webapps/examples/WEB-INF/lib/jstl.jar
new file mode 100644
index 0000000..a02abec
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/lib/jstl.jar
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/lib/standard.jar b/tomcat-uid/webapps/examples/WEB-INF/lib/standard.jar
new file mode 100644
index 0000000..bc528ac
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/lib/standard.jar
Binary files differ
diff --git a/tomcat-uid/webapps/examples/WEB-INF/tags/displayProducts.tag b/tomcat-uid/webapps/examples/WEB-INF/tags/displayProducts.tag
new file mode 100644
index 0000000..508852e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/tags/displayProducts.tag
@@ -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.
+-->
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ attribute name="normalPrice" fragment="true" %>
+<%@ attribute name="onSale" fragment="true" %>
+<%@ variable name-given="name" %>
+<%@ variable name-given="price" %>
+<%@ variable name-given="origPrice" %>
+<%@ variable name-given="salePrice" %>
+
+<table border="1">
+ <tr>
+ <td>
+ <c:set var="name" value="Hand-held Color PDA"/>
+ <c:set var="price" value="$298.86"/>
+ <jsp:invoke fragment="normalPrice"/>
+ </td>
+ <td>
+ <c:set var="name" value="4-Pack 150 Watt Light Bulbs"/>
+ <c:set var="origPrice" value="$2.98"/>
+ <c:set var="salePrice" value="$2.32"/>
+ <jsp:invoke fragment="onSale"/>
+ </td>
+ <td>
+ <c:set var="name" value="Digital Cellular Phone"/>
+ <c:set var="price" value="$68.74"/>
+ <jsp:invoke fragment="normalPrice"/>
+ </td>
+ <td>
+ <c:set var="name" value="Baby Grand Piano"/>
+ <c:set var="price" value="$10,800.00"/>
+ <jsp:invoke fragment="normalPrice"/>
+ </td>
+ <td>
+ <c:set var="name" value="Luxury Car w/ Leather Seats"/>
+ <c:set var="origPrice" value="$23,980.00"/>
+ <c:set var="salePrice" value="$21,070.00"/>
+ <jsp:invoke fragment="onSale"/>
+ </td>
+ </tr>
+</table>
diff --git a/tomcat-uid/webapps/examples/WEB-INF/tags/helloWorld.tag b/tomcat-uid/webapps/examples/WEB-INF/tags/helloWorld.tag
new file mode 100644
index 0000000..f52e823
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/tags/helloWorld.tag
@@ -0,0 +1,17 @@
+<!--
+ 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.
+-->
+Hello, world!
diff --git a/tomcat-uid/webapps/examples/WEB-INF/tags/panel.tag b/tomcat-uid/webapps/examples/WEB-INF/tags/panel.tag
new file mode 100644
index 0000000..90aaf91
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/tags/panel.tag
@@ -0,0 +1,29 @@
+<!--
+ 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.
+-->
+<%@ attribute name="color" %>
+<%@ attribute name="bgcolor" %>
+<%@ attribute name="title" %>
+<table border="1" bgcolor="${color}">
+ <tr>
+ <td><b>${title}</b></td>
+ </tr>
+ <tr>
+ <td bgcolor="${bgcolor}">
+ <jsp:doBody/>
+ </td>
+ </tr>
+</table>
diff --git a/tomcat-uid/webapps/examples/WEB-INF/tags/xhtmlbasic.tag b/tomcat-uid/webapps/examples/WEB-INF/tags/xhtmlbasic.tag
new file mode 100644
index 0000000..d8af5e5
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/tags/xhtmlbasic.tag
@@ -0,0 +1,21 @@
+<!--
+ 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 XHTML Basic 1.0//EN"
+"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<jsp:doBody/>
+</html>
diff --git a/tomcat-uid/webapps/examples/WEB-INF/web.xml b/tomcat-uid/webapps/examples/WEB-INF/web.xml
new file mode 100644
index 0000000..955179e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/WEB-INF/web.xml
@@ -0,0 +1,307 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+ <description>
+ Servlet and JSP Examples.
+ </description>
+ <display-name>Servlet and JSP Examples</display-name>
+
+
+ <!-- Define servlet-mapped and path-mapped example filters -->
+ <filter>
+ <filter-name>Servlet Mapped Filter</filter-name>
+ <filter-class>filters.ExampleFilter</filter-class>
+ <init-param>
+ <param-name>attribute</param-name>
+ <param-value>filters.ExampleFilter.SERVLET_MAPPED</param-value>
+ </init-param>
+ </filter>
+ <filter>
+ <filter-name>Path Mapped Filter</filter-name>
+ <filter-class>filters.ExampleFilter</filter-class>
+ <init-param>
+ <param-name>attribute</param-name>
+ <param-value>filters.ExampleFilter.PATH_MAPPED</param-value>
+ </init-param>
+ </filter>
+ <filter>
+ <filter-name>Request Dumper Filter</filter-name>
+ <filter-class>filters.RequestDumperFilter</filter-class>
+ </filter>
+
+ <!-- Example filter to set character encoding on each request -->
+ <filter>
+ <filter-name>Set Character Encoding</filter-name>
+ <filter-class>filters.SetCharacterEncodingFilter</filter-class>
+ <init-param>
+ <param-name>encoding</param-name>
+ <param-value>EUC_JP</param-value>
+ </init-param>
+ </filter>
+
+ <filter>
+ <filter-name>Compression Filter</filter-name>
+ <filter-class>compressionFilters.CompressionFilter</filter-class>
+
+ <init-param>
+ <param-name>compressionThreshold</param-name>
+ <param-value>10</param-value>
+ </init-param>
+ <init-param>
+ <param-name>debug</param-name>
+ <param-value>0</param-value>
+ </init-param>
+ </filter>
+
+ <!-- Define filter mappings for the defined filters -->
+ <filter-mapping>
+ <filter-name>Servlet Mapped Filter</filter-name>
+ <servlet-name>invoker</servlet-name>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>Path Mapped Filter</filter-name>
+ <url-pattern>/servlet/*</url-pattern>
+ </filter-mapping>
+
+<!-- Example filter mapping to apply the "Set Character Encoding" filter
+ to *all* requests processed by this web application -->
+<!--
+ <filter-mapping>
+ <filter-name>Set Character Encoding</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+-->
+
+<!--
+ <filter-mapping>
+ <filter-name>Compression Filter</filter-name>
+ <url-pattern>/CompressionTest</url-pattern>
+ </filter-mapping>
+-->
+
+<!--
+ <filter-mapping>
+ <filter-name>Request Dumper Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+-->
+
+ <!-- Define example application events listeners -->
+ <listener>
+ <listener-class>listeners.ContextListener</listener-class>
+ </listener>
+ <listener>
+ <listener-class>listeners.SessionListener</listener-class>
+ </listener>
+
+ <!-- Define servlets that are included in the example application -->
+
+ <servlet>
+ <servlet-name>servletToJsp</servlet-name>
+ <servlet-class>servletToJsp</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>ChatServlet</servlet-name>
+ <servlet-class>chat.ChatServlet</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>CompressionFilterTestServlet</servlet-name>
+ <servlet-class>compressionFilters.CompressionFilterTestServlet</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>HelloWorldExample</servlet-name>
+ <servlet-class>HelloWorldExample</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>RequestInfoExample</servlet-name>
+ <servlet-class>RequestInfoExample</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>RequestHeaderExample</servlet-name>
+ <servlet-class>RequestHeaderExample</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>RequestParamExample</servlet-name>
+ <servlet-class>RequestParamExample</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>CookieExample</servlet-name>
+ <servlet-class>CookieExample</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>SessionExample</servlet-name>
+ <servlet-class>SessionExample</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ChatServlet</servlet-name>
+ <url-pattern>/jsp/chat/chat</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>CompressionFilterTestServlet</servlet-name>
+ <url-pattern>/CompressionTest</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>HelloWorldExample</servlet-name>
+ <url-pattern>/servlets/servlet/HelloWorldExample</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>RequestInfoExample</servlet-name>
+ <url-pattern>/servlets/servlet/RequestInfoExample/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>RequestHeaderExample</servlet-name>
+ <url-pattern>/servlets/servlet/RequestHeaderExample</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>RequestParamExample</servlet-name>
+ <url-pattern>/servlets/servlet/RequestParamExample</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>CookieExample</servlet-name>
+ <url-pattern>/servlets/servlet/CookieExample</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>SessionExample</servlet-name>
+ <url-pattern>/servlets/servlet/SessionExample</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>servletToJsp</servlet-name>
+ <url-pattern>/servletToJsp</url-pattern>
+ </servlet-mapping>
+
+ <jsp-config>
+ <taglib>
+ <taglib-uri>
+ http://tomcat.apache.org/debug-taglib
+ </taglib-uri>
+ <taglib-location>
+ /WEB-INF/jsp/debug-taglib.tld
+ </taglib-location>
+ </taglib>
+
+ <taglib>
+ <taglib-uri>
+ http://tomcat.apache.org/examples-taglib
+ </taglib-uri>
+ <taglib-location>
+ /WEB-INF/jsp/example-taglib.tld
+ </taglib-location>
+ </taglib>
+
+ <taglib>
+ <taglib-uri>
+ http://tomcat.apache.org/jsp2-example-taglib
+ </taglib-uri>
+ <taglib-location>
+ /WEB-INF/jsp2/jsp2-example-taglib.tld
+ </taglib-location>
+ </taglib>
+
+ <jsp-property-group>
+ <description>
+ Special property group for JSP Configuration JSP example.
+ </description>
+ <display-name>JSPConfiguration</display-name>
+ <url-pattern>/jsp/jsp2/misc/config.jsp</url-pattern>
+ <el-ignored>true</el-ignored>
+ <page-encoding>ISO-8859-1</page-encoding>
+ <scripting-invalid>true</scripting-invalid>
+ <include-prelude>/jsp/jsp2/misc/prelude.jspf</include-prelude>
+ <include-coda>/jsp/jsp2/misc/coda.jspf</include-coda>
+ </jsp-property-group>
+ </jsp-config>
+
+ <security-constraint>
+ <display-name>Example Security Constraint</display-name>
+ <web-resource-collection>
+ <web-resource-name>Protected Area</web-resource-name>
+ <!-- Define the context-relative URL(s) to be protected -->
+ <url-pattern>/jsp/security/protected/*</url-pattern>
+ <!-- If you list http methods, only those methods are protected -->
+ <http-method>DELETE</http-method>
+ <http-method>GET</http-method>
+ <http-method>POST</http-method>
+ <http-method>PUT</http-method>
+ </web-resource-collection>
+ <auth-constraint>
+ <!-- Anyone with one of the listed roles may access this area -->
+ <role-name>tomcat</role-name>
+ <role-name>role1</role-name>
+ </auth-constraint>
+ </security-constraint>
+
+ <!-- Default login configuration uses form-based authentication -->
+ <login-config>
+ <auth-method>FORM</auth-method>
+ <realm-name>Example Form-Based Authentication Area</realm-name>
+ <form-login-config>
+ <form-login-page>/jsp/security/protected/login.jsp</form-login-page>
+ <form-error-page>/jsp/security/protected/error.jsp</form-error-page>
+ </form-login-config>
+ </login-config>
+
+ <!-- Security roles referenced by this web application -->
+ <security-role>
+ <role-name>role1</role-name>
+ </security-role>
+ <security-role>
+ <role-name>tomcat</role-name>
+ </security-role>
+
+ <!-- Environment entry examples -->
+ <!--env-entry>
+ <env-entry-description>
+ The maximum number of tax exemptions allowed to be set.
+ </env-entry-description>
+ <env-entry-name>maxExemptions</env-entry-name>
+ <env-entry-type>java.lang.Integer</env-entry-type>
+ <env-entry-value>15</env-entry-value>
+ </env-entry-->
+ <env-entry>
+ <env-entry-name>minExemptions</env-entry-name>
+ <env-entry-type>java.lang.Integer</env-entry-type>
+ <env-entry-value>1</env-entry-value>
+ </env-entry>
+ <env-entry>
+ <env-entry-name>foo/name1</env-entry-name>
+ <env-entry-type>java.lang.String</env-entry-type>
+ <env-entry-value>value1</env-entry-value>
+ </env-entry>
+ <env-entry>
+ <env-entry-name>foo/bar/name2</env-entry-name>
+ <env-entry-type>java.lang.Boolean</env-entry-type>
+ <env-entry-value>true</env-entry-value>
+ </env-entry>
+ <env-entry>
+ <env-entry-name>name3</env-entry-name>
+ <env-entry-type>java.lang.Integer</env-entry-type>
+ <env-entry-value>1</env-entry-value>
+ </env-entry>
+ <env-entry>
+ <env-entry-name>foo/name4</env-entry-name>
+ <env-entry-type>java.lang.Integer</env-entry-type>
+ <env-entry-value>10</env-entry-value>
+ </env-entry>
+
+</web-app>
diff --git a/tomcat-uid/webapps/examples/index.html b/tomcat-uid/webapps/examples/index.html
new file mode 100644
index 0000000..8dfea59
--- /dev/null
+++ b/tomcat-uid/webapps/examples/index.html
@@ -0,0 +1,29 @@
+<!--
+ 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.0 Transitional//EN">
+<HTML><HEAD><TITLE>Apache Tomcat Examples</TITLE>
+<META http-equiv=Content-Type content="text/html">
+</HEAD>
+<BODY>
+<P>
+<H3>Apache Tomcat Examples</H3>
+<P></P>
+<ul>
+<li><a href="servlets">Servlets examples</a></li>
+<li><a href="jsp">JSP Examples</a></li>
+</ul>
+</BODY></HTML>
diff --git a/tomcat-uid/webapps/examples/jsp/cal/Entries.java.html b/tomcat-uid/webapps/examples/jsp/cal/Entries.java.html
new file mode 100644
index 0000000..6093d31
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/cal/Entries.java.html
@@ -0,0 +1,74 @@
+<html><body><pre>
+/*
+* 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.
+*/
+package cal;
+
+import java.util.Hashtable;
+import javax.servlet.http.*;
+
+public class Entries {
+
+ private Hashtable entries;
+ private static final String[] time = {"8am", "9am", "10am", "11am", "12pm",
+ "1pm", "2pm", "3pm", "4pm", "5pm", "6pm",
+ "7pm", "8pm" };
+ public static final int rows = 12;
+
+ public Entries () {
+ entries = new Hashtable (rows);
+ for (int i=0; i < rows; i++) {
+ entries.put (time[i], new Entry(time[i]));
+ }
+ }
+
+ public int getRows () {
+ return rows;
+ }
+
+ public Entry getEntry (int index) {
+ return (Entry)this.entries.get(time[index]);
+ }
+
+ public int getIndex (String tm) {
+ for (int i=0; i<rows; i++)
+ if(tm.equals(time[i])) return i;
+ return -1;
+ }
+
+ public void processRequest (HttpServletRequest request, String tm) {
+ int index = getIndex (tm);
+ if (index >= 0) {
+ String descr = request.getParameter ("description");
+ ((Entry)entries.get(time[index])).setDescription (descr);
+ }
+ }
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/cal/Entry.java.html b/tomcat-uid/webapps/examples/jsp/cal/Entry.java.html
new file mode 100644
index 0000000..f982750
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/cal/Entry.java.html
@@ -0,0 +1,57 @@
+<html><body><pre>
+/*
+* 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.
+*/
+
+package cal;
+
+public class Entry {
+
+ String hour;
+ String description;
+ String color;
+
+ public Entry (String hour) {
+ this.hour = hour;
+ this.description = "";
+
+ }
+
+ public String getHour () {
+ return this.hour;
+ }
+
+ public String getColor () {
+ if (description.equals("")) return "lightblue";
+ else return "red";
+ }
+
+ public String getDescription () {
+ if (description.equals("")) return "None";
+ else return this.description;
+ }
+
+ public void setDescription (String descr) {
+ description = descr;
+ }
+
+}
+
+
+
+
+
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/cal/JspCalendar.java.html b/tomcat-uid/webapps/examples/jsp/cal/JspCalendar.java.html
new file mode 100644
index 0000000..e1b4b83
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/cal/JspCalendar.java.html
@@ -0,0 +1,156 @@
+<html><body><pre>
+/*
+* 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.
+*/
+
+package cal;
+
+import java.util.*;
+
+public class JspCalendar {
+ Calendar calendar = null;
+ Date currentDate;
+
+ public JspCalendar() {
+ calendar = Calendar.getInstance();
+ Date trialTime = new Date();
+ calendar.setTime(trialTime);
+ }
+
+
+ public int getYear() {
+ return calendar.get(Calendar.YEAR);
+ }
+
+ public String getMonth() {
+ int m = getMonthInt();
+ String[] months = new String [] { "January", "February", "March",
+ "April", "May", "June",
+ "July", "August", "September",
+ "October", "November", "December" };
+ if (m > 12)
+ return "Unknown to Man";
+
+ return months[m - 1];
+
+ }
+
+ public String getDay() {
+ int x = getDayOfWeek();
+ String[] days = new String[] {"Sunday", "Monday", "Tuesday", "Wednesday",
+ "Thursday", "Friday", "Saturday"};
+
+ if (x > 7)
+ return "Unknown to Man";
+
+ return days[x - 1];
+
+ }
+
+ public int getMonthInt() {
+ return 1 + calendar.get(Calendar.MONTH);
+ }
+
+ public String getDate() {
+ return getMonthInt() + "/" + getDayOfMonth() + "/" + getYear();
+ }
+
+ public String getCurrentDate() {
+ Date dt = new Date ();
+ calendar.setTime (dt);
+ return getMonthInt() + "/" + getDayOfMonth() + "/" + getYear();
+
+ }
+
+ public String getNextDate() {
+ calendar.set (Calendar.DAY_OF_MONTH, getDayOfMonth() + 1);
+ return getDate ();
+ }
+
+ public String getPrevDate() {
+ calendar.set (Calendar.DAY_OF_MONTH, getDayOfMonth() - 1);
+ return getDate ();
+ }
+
+ public String getTime() {
+ return getHour() + ":" + getMinute() + ":" + getSecond();
+ }
+
+ public int getDayOfMonth() {
+ return calendar.get(Calendar.DAY_OF_MONTH);
+ }
+
+ public int getDayOfYear() {
+ return calendar.get(Calendar.DAY_OF_YEAR);
+ }
+
+ public int getWeekOfYear() {
+ return calendar.get(Calendar.WEEK_OF_YEAR);
+ }
+
+ public int getWeekOfMonth() {
+ return calendar.get(Calendar.WEEK_OF_MONTH);
+ }
+
+ public int getDayOfWeek() {
+ return calendar.get(Calendar.DAY_OF_WEEK);
+ }
+
+ public int getHour() {
+ return calendar.get(Calendar.HOUR_OF_DAY);
+ }
+
+ public int getMinute() {
+ return calendar.get(Calendar.MINUTE);
+ }
+
+
+ public int getSecond() {
+ return calendar.get(Calendar.SECOND);
+ }
+
+
+ public int getEra() {
+ return calendar.get(Calendar.ERA);
+ }
+
+ public String getUSTimeZone() {
+ String[] zones = new String[] {"Hawaii", "Alaskan", "Pacific",
+ "Mountain", "Central", "Eastern"};
+
+ return zones[10 + getZoneOffset()];
+ }
+
+ public int getZoneOffset() {
+ return calendar.get(Calendar.ZONE_OFFSET)/(60*60*1000);
+ }
+
+
+ public int getDSTOffset() {
+ return calendar.get(Calendar.DST_OFFSET)/(60*60*1000);
+ }
+
+
+ public int getAMPM() {
+ return calendar.get(Calendar.AM_PM);
+ }
+}
+
+
+
+
+
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/cal/TableBean.java.html b/tomcat-uid/webapps/examples/jsp/cal/TableBean.java.html
new file mode 100644
index 0000000..a81a66b
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/cal/TableBean.java.html
@@ -0,0 +1,102 @@
+<html><body><pre>
+/*
+* 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.
+*/
+package cal;
+
+import javax.servlet.http.*;
+import java.util.Hashtable;
+
+public class TableBean {
+
+ Hashtable table;
+ JspCalendar JspCal;
+ Entries entries;
+ String date;
+ String name = null;
+ String email = null;
+ boolean processError = false;
+
+ public TableBean () {
+ this.table = new Hashtable (10);
+ this.JspCal = new JspCalendar ();
+ this.date = JspCal.getCurrentDate ();
+ }
+
+ public void setName (String nm) {
+ this.name = nm;
+ }
+
+ public String getName () {
+ return this.name;
+ }
+
+ public void setEmail (String mail) {
+ this.email = mail;
+ }
+
+ public String getEmail () {
+ return this.email;
+ }
+
+ public String getDate () {
+ return this.date;
+ }
+
+ public Entries getEntries () {
+ return this.entries;
+ }
+
+ public void processRequest (HttpServletRequest request) {
+
+ // Get the name and e-mail.
+ this.processError = false;
+ if (name == null || name.equals("")) setName(request.getParameter ("name"));
+ if (email == null || email.equals("")) setEmail(request.getParameter ("email"));
+ if (name == null || email == null ||
+ name.equals("") || email.equals("")) {
+ this.processError = true;
+ return;
+ }
+
+ // Get the date.
+ String dateR = request.getParameter ("date");
+ if (dateR == null) date = JspCal.getCurrentDate ();
+ else if (dateR.equalsIgnoreCase("next")) date = JspCal.getNextDate ();
+ else if (dateR.equalsIgnoreCase("prev")) date = JspCal.getPrevDate ();
+
+ entries = (Entries) table.get (date);
+ if (entries == null) {
+ entries = new Entries ();
+ table.put (date, entries);
+ }
+
+ // If time is provided add the event.
+ String time = request.getParameter("time");
+ if (time != null) entries.processRequest (request, time);
+ }
+
+ public boolean getProcessError () {
+ return this.processError;
+ }
+}
+
+
+
+
+
+
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/cal/cal1.jsp b/tomcat-uid/webapps/examples/jsp/cal/cal1.jsp
new file mode 100644
index 0000000..a691df4
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/cal/cal1.jsp
@@ -0,0 +1,95 @@
+<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>
+ Calendar: A JSP APPLICATION
+</TITLE></HEAD>
+
+
+<BODY BGCOLOR="white">
+
+<%@ page language="java" import="cal.*" %>
+<jsp:useBean id="table" scope="session" class="cal.TableBean" />
+
+<%
+ table.processRequest(request);
+ if (table.getProcessError() == false) {
+%>
+
+<!-- html table goes here -->
+<CENTER>
+<TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15>
+<TR>
+<TD ALIGN=CENTER> <A HREF=cal1.jsp?date=prev> prev </A>
+<TD ALIGN=CENTER> Calendar:<%= table.getDate() %></TD>
+<TD ALIGN=CENTER> <A HREF=cal1.jsp?date=next> next </A>
+</TR>
+</TABLE>
+
+<!-- the main table -->
+<TABLE WIDTH=60% BGCOLOR=lightblue BORDER=1 CELLPADDING=10>
+<TR>
+<TH> Time </TH>
+<TH> Appointment </TH>
+</TR>
+<FORM METHOD=POST ACTION=cal1.jsp>
+<%
+ for(int i=0; i<table.getEntries().getRows(); i++) {
+ cal.Entry entr = table.getEntries().getEntry(i);
+%>
+ <TR>
+ <TD>
+ <A HREF=cal2.jsp?time=<%= entr.getHour() %>>
+ <%= entr.getHour() %> </A>
+ </TD>
+ <TD BGCOLOR=<%= entr.getColor() %>>
+ <% out.print(util.HTMLFilter.filter(entr.getDescription())); %>
+ </TD>
+ </TR>
+<%
+ }
+%>
+</FORM>
+</TABLE>
+<BR>
+
+<!-- footer -->
+<TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15>
+<TR>
+<TD ALIGN=CENTER> <% out.print(util.HTMLFilter.filter(table.getName())); %> :
+ <% out.print(util.HTMLFilter.filter(table.getEmail())); %> </TD>
+</TR>
+</TABLE>
+</CENTER>
+
+<%
+ } else {
+%>
+<font size=5>
+ You must enter your name and email address correctly.
+</font>
+<%
+ }
+%>
+
+
+</BODY>
+</HTML>
+
+
+
+
diff --git a/tomcat-uid/webapps/examples/jsp/cal/cal1.jsp.html b/tomcat-uid/webapps/examples/jsp/cal/cal1.jsp.html
new file mode 100644
index 0000000..f9c3689
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/cal/cal1.jsp.html
@@ -0,0 +1,97 @@
+<html><body><pre>
+<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>
+ Calendar: A JSP APPLICATION
+</TITLE></HEAD>
+
+
+<BODY BGCOLOR="white">
+
+<%@ page language="java" import="cal.*" %>
+<jsp:useBean id="table" scope="session" class="cal.TableBean" />
+
+<%
+ table.processRequest(request);
+ if (table.getProcessError() == false) {
+%>
+
+<!-- html table goes here -->
+<CENTER>
+<TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15>
+<TR>
+<TD ALIGN=CENTER> <A HREF=cal1.jsp?date=prev> prev </A>
+<TD ALIGN=CENTER> Calendar:<%= table.getDate() %></TD>
+<TD ALIGN=CENTER> <A HREF=cal1.jsp?date=next> next </A>
+</TR>
+</TABLE>
+
+<!-- the main table -->
+<TABLE WIDTH=60% BGCOLOR=lightblue BORDER=1 CELLPADDING=10>
+<TR>
+<TH> Time </TH>
+<TH> Appointment </TH>
+</TR>
+<FORM METHOD=POST ACTION=cal1.jsp>
+<%
+ for(int i=0; i<table.getEntries().getRows(); i++) {
+ cal.Entry entr = table.getEntries().getEntry(i);
+%>
+ <TR>
+ <TD>
+ <A HREF=cal2.jsp?time=<%= entr.getHour() %>>
+ <%= entr.getHour() %> </A>
+ </TD>
+ <TD BGCOLOR=<%= entr.getColor() %>>
+ <% out.print(util.HTMLFilter.filter(entr.getDescription())); %>
+ </TD>
+ </TR>
+<%
+ }
+%>
+</FORM>
+</TABLE>
+<BR>
+
+<!-- footer -->
+<TABLE WIDTH=60% BGCOLOR=yellow CELLPADDING=15>
+<TR>
+<TD ALIGN=CENTER> <% out.print(util.HTMLFilter.filter(table.getName())); %> :
+ <% out.print(util.HTMLFilter.filter(table.getEmail())); %> </TD>
+</TR>
+</TABLE>
+</CENTER>
+
+<%
+ } else {
+%>
+<font size=5>
+ You must enter your name and email address correctly.
+</font>
+<%
+ }
+%>
+
+
+</BODY>
+</HTML>
+
+
+
+
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/cal/cal2.jsp b/tomcat-uid/webapps/examples/jsp/cal/cal2.jsp
new file mode 100644
index 0000000..b6d435b
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/cal/cal2.jsp
@@ -0,0 +1,45 @@
+<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>
+ Calendar: A JSP APPLICATION
+</TITLE></HEAD>
+
+
+<BODY BGCOLOR="white">
+<jsp:useBean id="table" scope="session" class="cal.TableBean" />
+
+<%
+ String time = request.getParameter ("time");
+%>
+
+<FONT SIZE=5> Please add the following event:
+<BR> <h3> Date <%= table.getDate() %>
+<BR> Time <%= util.HTMLFilter.filter(time) %> </h3>
+</FONT>
+<FORM METHOD=POST ACTION=cal1.jsp>
+<BR>
+<BR> <INPUT NAME="date" TYPE=HIDDEN VALUE="current">
+<BR> <INPUT NAME="time" TYPE=HIDDEN VALUE="<%= util.HTMLFilter.filter(time) %>">
+<BR> <h2> Description of the event <INPUT NAME="description" TYPE=TEXT SIZE=20> </h2>
+<BR> <INPUT TYPE=SUBMIT VALUE="submit">
+</FORM>
+
+</BODY>
+</HTML>
+
diff --git a/tomcat-uid/webapps/examples/jsp/cal/cal2.jsp.html b/tomcat-uid/webapps/examples/jsp/cal/cal2.jsp.html
new file mode 100644
index 0000000..2548ce7
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/cal/cal2.jsp.html
@@ -0,0 +1,47 @@
+<html><body><pre>
+<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>
+ Calendar: A JSP APPLICATION
+</TITLE></HEAD>
+
+
+<BODY BGCOLOR="white">
+<jsp:useBean id="table" scope="session" class="cal.TableBean" />
+
+<%
+ String time = request.getParameter ("time");
+%>
+
+<FONT SIZE=5> Please add the following event:
+<BR> <h3> Date <%= table.getDate() %>
+<BR> Time <%= util.HTMLFilter.filter(time) %> </h3>
+</FONT>
+<FORM METHOD=POST ACTION=cal1.jsp>
+<BR>
+<BR> <INPUT NAME="date" TYPE=HIDDEN VALUE="current">
+<BR> <INPUT NAME="time" TYPE=HIDDEN VALUE="<%= util.HTMLFilter.filter(time) %>">
+<BR> <h2> Description of the event <INPUT NAME="description" TYPE=TEXT SIZE=20> </h2>
+<BR> <INPUT TYPE=SUBMIT VALUE="submit">
+</FORM>
+
+</BODY>
+</HTML>
+
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/cal/calendar.html b/tomcat-uid/webapps/examples/jsp/cal/calendar.html
new file mode 100644
index 0000000..d77cea5
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/cal/calendar.html
@@ -0,0 +1,43 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="login.html"><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>
+
+<h2> Source Code for Calendar Example. <br>
+<h3><a href="cal1.jsp.html">cal1.jsp<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="cal2.jsp.html">cal2.jsp<font color="#0000FF"></a>
+ </font> </h3>
+
+<br>
+<h2> Beans.
+<h3><a href="TableBean.java.html">TableBean<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="Entries.java.html">Entries<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="Entry.java.html">Entry<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/cal/login.html b/tomcat-uid/webapps/examples/jsp/cal/login.html
new file mode 100644
index 0000000..398b39b
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/cal/login.html
@@ -0,0 +1,47 @@
+<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> Login page for the calendar. </title>
+</head>
+
+<body bgcolor="white">
+<center>
+
+ <font size=7 color="red"> Please Enter the following information: </font>
+
+<br>
+ <form method=GET action=cal1.jsp>
+
+ <font size=5> Name <input type=text name="name" size=20>
+ </font>
+ <br>
+ <font size=5> Email <input type=text name="email" size=20>
+ </font>
+ <br>
+ <input type=submit name=action value="Submit">
+
+ </form>
+<hr>
+<font size=3 color="red"> Note: This application does not implement the complete
+functionality of a typical calendar application. It demonstrates a way JSP can be
+used with html tables and forms.</font>
+
+</center>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/chat/index.jsp b/tomcat-uid/webapps/examples/jsp/chat/index.jsp
new file mode 100644
index 0000000..b7bc0d0
--- /dev/null
+++ b/tomcat-uid/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-uid/webapps/examples/jsp/chat/index.jsp.html b/tomcat-uid/webapps/examples/jsp/chat/index.jsp.html
new file mode 100644
index 0000000..0b98ebf
--- /dev/null
+++ b/tomcat-uid/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-uid/webapps/examples/jsp/chat/login.jsp b/tomcat-uid/webapps/examples/jsp/chat/login.jsp
new file mode 100644
index 0000000..e1c6496
--- /dev/null
+++ b/tomcat-uid/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-uid/webapps/examples/jsp/chat/login.jsp.html b/tomcat-uid/webapps/examples/jsp/chat/login.jsp.html
new file mode 100644
index 0000000..d0fbe40
--- /dev/null
+++ b/tomcat-uid/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-uid/webapps/examples/jsp/chat/post.jsp b/tomcat-uid/webapps/examples/jsp/chat/post.jsp
new file mode 100644
index 0000000..cc8134d
--- /dev/null
+++ b/tomcat-uid/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-uid/webapps/examples/jsp/chat/post.jsp.html b/tomcat-uid/webapps/examples/jsp/chat/post.jsp.html
new file mode 100644
index 0000000..90fa323
--- /dev/null
+++ b/tomcat-uid/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>
diff --git a/tomcat-uid/webapps/examples/jsp/checkbox/CheckTest.html b/tomcat-uid/webapps/examples/jsp/checkbox/CheckTest.html
new file mode 100644
index 0000000..e950ff4
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/checkbox/CheckTest.html
@@ -0,0 +1,56 @@
+<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>
+checkbox.CheckTest Bean Properties
+</title>
+<BODY BGCOLOR="white">
+<H2>
+checkbox.CheckTest Bean Properties
+</H2>
+<HR>
+<DL>
+<DT>public class <B>CheckTest</B><DT>extends Object</DL>
+
+<P>
+<HR>
+
+<P>
+
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0">
+<TR BGCOLOR="#EEEEFF">
+<TD COLSPAN=3><FONT SIZE="+2">
+<B>Properties Summary</B></FONT></TD>
+</TR>
+<TR BGCOLOR="white">
+<td align="right" valign="top" width="1%">
+<FONT SIZE="-1">
+String
+</FONT></TD>
+<TD><B>CheckTest:fruit</B>
+<BR>
+ </TD>
+<td width="1%">
+<FONT SIZE="-1">
+Multi
+</FONT></TD>
+</TABLE>
+<HR>
+</BODY>
+</HTML>
diff --git a/tomcat-uid/webapps/examples/jsp/checkbox/check.html b/tomcat-uid/webapps/examples/jsp/checkbox/check.html
new file mode 100644
index 0000000..148fe40
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/checkbox/check.html
@@ -0,0 +1,38 @@
+<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.
+-->
+
+<BODY bgcolor="white">
+
+
+<FORM TYPE=POST ACTION=checkresult.jsp>
+<BR>
+<font size=5 color="red">
+Check all Favorite fruits: <br>
+
+<input TYPE=checkbox name=fruit VALUE=apples> Apples <BR>
+<input TYPE=checkbox name=fruit VALUE=grapes> Grapes <BR>
+<input TYPE=checkbox name=fruit VALUE=oranges> Oranges <BR>
+<input TYPE=checkbox name=fruit VALUE=melons> Melons <BR>
+
+
+<br> <INPUT TYPE=submit name=submit Value="Submit">
+
+</font>
+</FORM>
+</BODY>
+</HTML>
diff --git a/tomcat-uid/webapps/examples/jsp/checkbox/checkresult.jsp b/tomcat-uid/webapps/examples/jsp/checkbox/checkresult.jsp
new file mode 100644
index 0000000..db87ca1
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/checkbox/checkresult.jsp
@@ -0,0 +1,64 @@
+<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.
+-->
+
+<body bgcolor="white">
+<font size=5 color="red">
+<%! String[] fruits; %>
+<jsp:useBean id="foo" scope="page" class="checkbox.CheckTest" />
+
+<jsp:setProperty name="foo" property="fruit" param="fruit" />
+<hr>
+The checked fruits (got using request) are: <br>
+<%
+ fruits = request.getParameterValues("fruit");
+%>
+<ul>
+<%
+ if (fruits != null) {
+ for (int i = 0; i < fruits.length; i++) {
+%>
+<li>
+<%
+ out.println (util.HTMLFilter.filter(fruits[i]));
+ }
+ } else out.println ("none selected");
+%>
+</ul>
+<br>
+<hr>
+
+The checked fruits (got using beans) are <br>
+
+<%
+ fruits = foo.getFruit();
+%>
+<ul>
+<%
+ if (!fruits[0].equals("1")) {
+ for (int i = 0; i < fruits.length; i++) {
+%>
+<li>
+<%
+ out.println (util.HTMLFilter.filter(fruits[i]));
+ }
+ } else out.println ("none selected");
+%>
+</ul>
+</font>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/checkbox/checkresult.jsp.html b/tomcat-uid/webapps/examples/jsp/checkbox/checkresult.jsp.html
new file mode 100644
index 0000000..d5442d1
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/checkbox/checkresult.jsp.html
@@ -0,0 +1,66 @@
+<html><body><pre>
+<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.
+-->
+
+<body bgcolor="white">
+<font size=5 color="red">
+<%! String[] fruits; %>
+<jsp:useBean id="foo" scope="page" class="checkbox.CheckTest" />
+
+<jsp:setProperty name="foo" property="fruit" param="fruit" />
+<hr>
+The checked fruits (got using request) are: <br>
+<%
+ fruits = request.getParameterValues("fruit");
+%>
+<ul>
+<%
+ if (fruits != null) {
+ for (int i = 0; i < fruits.length; i++) {
+%>
+<li>
+<%
+ out.println (util.HTMLFilter.filter(fruits[i]));
+ }
+ } else out.println ("none selected");
+%>
+</ul>
+<br>
+<hr>
+
+The checked fruits (got using beans) are <br>
+
+<%
+ fruits = foo.getFruit();
+%>
+<ul>
+<%
+ if (!fruits[0].equals("1")) {
+ for (int i = 0; i < fruits.length; i++) {
+%>
+<li>
+<%
+ out.println (util.HTMLFilter.filter(fruits[i]));
+ }
+ } else out.println ("none selected");
+%>
+</ul>
+</font>
+</body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/checkbox/cresult.html b/tomcat-uid/webapps/examples/jsp/checkbox/cresult.html
new file mode 100644
index 0000000..c7eabce
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/checkbox/cresult.html
@@ -0,0 +1,34 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="check.html"><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><a href="checkresult.jsp.html">Source Code for Checkbox Example<font color="#0000FF"></a>
+ </font> </h3>
+
+<h3><a href="CheckTest.html">Property Sheet for CheckTest
+<font color="#0000FF"></a> </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/colors/ColorGameBean.html b/tomcat-uid/webapps/examples/jsp/colors/ColorGameBean.html
new file mode 100644
index 0000000..dcfc5c8
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/colors/ColorGameBean.html
@@ -0,0 +1,116 @@
+<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>
+colors.ColorGameBean Bean Properties
+</title>
+<BODY BGCOLOR="white">
+<H2>
+colors.ColorGameBean Bean Properties
+</H2>
+<HR>
+<DL>
+<DT>public class <B>ColorGameBean</B><DT>extends Object</DL>
+
+<P>
+<HR>
+
+<P>
+
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0">
+<TR BGCOLOR="#EEEEFF">
+<TD COLSPAN=3><FONT SIZE="+2">
+<B>Properties Summary</B></FONT></TD>
+</TR>
+<TR BGCOLOR="white">
+<td align="right" valign="top" width="1%">
+<FONT SIZE="-1">
+String
+</FONT></TD>
+<TD><B>ColorGameBean:color2</B>
+<BR>
+ </TD>
+<td width="1%">
+<FONT SIZE="-1">
+Single
+</FONT></TD>
+<TR BGCOLOR="white">
+<td align="right" valign="top" width="1%">
+<FONT SIZE="-1">
+String
+</FONT></TD>
+<TD><B>ColorGameBean:color1</B>
+<BR>
+ </TD>
+<td width="1%">
+<FONT SIZE="-1">
+Single
+</FONT></TD>
+<TR BGCOLOR="white">
+<td align="right" valign="top" width="1%">
+<FONT SIZE="-1">
+int
+</FONT></TD>
+<TD><B>ColorGameBean:attempts</B>
+<BR>
+ </TD>
+<td width="1%">
+<FONT SIZE="-1">
+Single
+</FONT></TD>
+<TR BGCOLOR="white">
+<td align="right" valign="top" width="1%">
+<FONT SIZE="-1">
+boolean
+</FONT></TD>
+<TD><B>ColorGameBean:hint</B>
+<BR>
+ </TD>
+<td width="1%">
+<FONT SIZE="-1">
+Single
+</FONT></TD>
+<TR BGCOLOR="white">
+<td align="right" valign="top" width="1%">
+<FONT SIZE="-1">
+boolean
+</FONT></TD>
+<TD><B>ColorGameBean:success</B>
+<BR>
+ </TD>
+<td width="1%">
+<FONT SIZE="-1">
+Single
+</FONT></TD>
+<TR BGCOLOR="white">
+<td align="right" valign="top" width="1%">
+<FONT SIZE="-1">
+boolean
+</FONT></TD>
+<TD><B>ColorGameBean:hintTaken</B>
+<BR>
+ </TD>
+<td width="1%">
+<FONT SIZE="-1">
+Single
+</FONT></TD>
+</TABLE>
+<HR>
+</BODY>
+</HTML>
diff --git a/tomcat-uid/webapps/examples/jsp/colors/clr.html b/tomcat-uid/webapps/examples/jsp/colors/clr.html
new file mode 100644
index 0000000..58107bc
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/colors/clr.html
@@ -0,0 +1,34 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="colors.html"><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><a href="colrs.jsp.html">Source Code for Color Example<font color="#0000FF"></a>
+ </font> </h3>
+
+<h3><a href="ColorGameBean.html">Property Sheet for ColorGameBean
+<font color="#0000FF"></a> </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/colors/colors.html b/tomcat-uid/webapps/examples/jsp/colors/colors.html
new file mode 100644
index 0000000..086738d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/colors/colors.html
@@ -0,0 +1,47 @@
+<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.
+-->
+
+<body bgcolor= white>
+<font size=6 color=red>
+
+<hr>
+This web page is an example using JSP and BEANs.
+<p>
+Guess my favorite two colors
+
+<p> If you fail to guess both of them - you get yellow on red.
+
+<p> If you guess one of them right, either your foreground or
+ your background will change to the color that was guessed right.
+
+<p> Guess them both right and your browser foreground/background
+ will change to my two favorite colors to display this page.
+
+<hr>
+<form method=GET action=colrs.jsp>
+Color #1: <input type=text name= color1 size=16>
+<br>
+Color #2: <input type=text name= color2 size=16>
+<p>
+<input type=submit name=action value="Submit">
+<input type=submit name=action value="Hint">
+</form>
+
+</font>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/colors/colrs.jsp b/tomcat-uid/webapps/examples/jsp/colors/colrs.jsp
new file mode 100644
index 0000000..e433bbd
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/colors/colrs.jsp
@@ -0,0 +1,70 @@
+<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.
+-->
+
+<jsp:useBean id="cb" scope="session" class="colors.ColorGameBean" />
+<jsp:setProperty name="cb" property="*" />
+
+<%
+ cb.processRequest(request);
+%>
+
+<body bgcolor=<%= cb.getColor1() %>>
+<font size=6 color=<%= cb.getColor2() %>>
+<p>
+
+<% if (cb.getHint()==true) { %>
+
+ <p> Hint #1: Vampires prey at night!
+ <p> <p> Hint #2: Nancy without the n.
+
+<% } %>
+
+<% if (cb.getSuccess()==true) { %>
+
+ <p> CONGRATULATIONS!!
+ <% if (cb.getHintTaken()==true) { %>
+
+ <p> ( although I know you cheated and peeked into the hints)
+
+ <% } %>
+
+<% } %>
+
+<p> Total attempts so far: <%= cb.getAttempts() %>
+<p>
+
+<p>
+
+<form method=POST action=colrs.jsp>
+
+Color #1: <input type=text name= color1 size=16>
+
+<br>
+
+Color #2: <input type=text name= color2 size=16>
+
+<p>
+
+<input type=submit name=action value="Submit">
+<input type=submit name=action value="Hint">
+
+</form>
+
+</font>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/colors/colrs.jsp.html b/tomcat-uid/webapps/examples/jsp/colors/colrs.jsp.html
new file mode 100644
index 0000000..41af88b
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/colors/colrs.jsp.html
@@ -0,0 +1,72 @@
+<html><body><pre>
+<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.
+-->
+
+<jsp:useBean id="cb" scope="session" class="colors.ColorGameBean" />
+<jsp:setProperty name="cb" property="*" />
+
+<%
+ cb.processRequest(request);
+%>
+
+<body bgcolor=<%= cb.getColor1() %>>
+<font size=6 color=<%= cb.getColor2() %>>
+<p>
+
+<% if (cb.getHint()==true) { %>
+
+ <p> Hint #1: Vampires prey at night!
+ <p> <p> Hint #2: Nancy without the n.
+
+<% } %>
+
+<% if (cb.getSuccess()==true) { %>
+
+ <p> CONGRATULATIONS!!
+ <% if (cb.getHintTaken()==true) { %>
+
+ <p> ( although I know you cheated and peeked into the hints)
+
+ <% } %>
+
+<% } %>
+
+<p> Total attempts so far: <%= cb.getAttempts() %>
+<p>
+
+<p>
+
+<form method=POST action=colrs.jsp>
+
+Color #1: <input type=text name= color1 size=16>
+
+<br>
+
+Color #2: <input type=text name= color2 size=16>
+
+<p>
+
+<input type=submit name=action value="Submit">
+<input type=submit name=action value="Hint">
+
+</form>
+
+</font>
+</body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/dates/date.html b/tomcat-uid/webapps/examples/jsp/dates/date.html
new file mode 100644
index 0000000..b779181
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/dates/date.html
@@ -0,0 +1,31 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="date.jsp"><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><a href="date.jsp.html">Source Code for Date Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/dates/date.jsp b/tomcat-uid/webapps/examples/jsp/dates/date.jsp
new file mode 100644
index 0000000..9c40d78
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/dates/date.jsp
@@ -0,0 +1,41 @@
+<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.
+-->
+
+<%@ page session="false"%>
+
+<body bgcolor="white">
+<jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type="dates.JspCalendar" />
+
+<font size=4>
+<ul>
+<li> Day of month: is <jsp:getProperty name="clock" property="dayOfMonth"/>
+<li> Year: is <jsp:getProperty name="clock" property="year"/>
+<li> Month: is <jsp:getProperty name="clock" property="month"/>
+<li> Time: is <jsp:getProperty name="clock" property="time"/>
+<li> Date: is <jsp:getProperty name="clock" property="date"/>
+<li> Day: is <jsp:getProperty name="clock" property="day"/>
+<li> Day Of Year: is <jsp:getProperty name="clock" property="dayOfYear"/>
+<li> Week Of Year: is <jsp:getProperty name="clock" property="weekOfYear"/>
+<li> era: is <jsp:getProperty name="clock" property="era"/>
+<li> DST Offset: is <jsp:getProperty name="clock" property="DSTOffset"/>
+<li> Zone Offset: is <jsp:getProperty name="clock" property="zoneOffset"/>
+</ul>
+</font>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/dates/date.jsp.html b/tomcat-uid/webapps/examples/jsp/dates/date.jsp.html
new file mode 100644
index 0000000..4a8f1e9
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/dates/date.jsp.html
@@ -0,0 +1,43 @@
+<html><body><pre>
+<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.
+-->
+
+<%@ page session="false"%>
+
+<body bgcolor="white">
+<jsp:useBean id='clock' scope='page' class='dates.JspCalendar' type="dates.JspCalendar" />
+
+<font size=4>
+<ul>
+<li> Day of month: is <jsp:getProperty name="clock" property="dayOfMonth"/>
+<li> Year: is <jsp:getProperty name="clock" property="year"/>
+<li> Month: is <jsp:getProperty name="clock" property="month"/>
+<li> Time: is <jsp:getProperty name="clock" property="time"/>
+<li> Date: is <jsp:getProperty name="clock" property="date"/>
+<li> Day: is <jsp:getProperty name="clock" property="day"/>
+<li> Day Of Year: is <jsp:getProperty name="clock" property="dayOfYear"/>
+<li> Week Of Year: is <jsp:getProperty name="clock" property="weekOfYear"/>
+<li> era: is <jsp:getProperty name="clock" property="era"/>
+<li> DST Offset: is <jsp:getProperty name="clock" property="DSTOffset"/>
+<li> Zone Offset: is <jsp:getProperty name="clock" property="zoneOffset"/>
+</ul>
+</font>
+
+</body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/error/er.html b/tomcat-uid/webapps/examples/jsp/error/er.html
new file mode 100644
index 0000000..523f7e3
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/error/er.html
@@ -0,0 +1,31 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="error.html"><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><a href="err.jsp.html">Source Code for Error Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/error/err.jsp b/tomcat-uid/webapps/examples/jsp/error/err.jsp
new file mode 100644
index 0000000..08030b0
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/error/err.jsp
@@ -0,0 +1,44 @@
+<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.
+-->
+<body bgcolor="lightblue">
+
+ <%@ page errorPage="errorpge.jsp" %>
+ <jsp:useBean id="foo" scope="request" class="error.Smart" />
+ <%
+ String name = null;
+
+ if (request.getParameter("name") == null) {
+ %>
+ <%@ include file="error.html" %>
+ <%
+ } else {
+ foo.setName(request.getParameter("name"));
+ if (foo.getName().equalsIgnoreCase("integra"))
+ name = "acura";
+ if (name.equalsIgnoreCase("acura")) {
+ %>
+
+ <H1> Yes!!! <a href="http://www.acura.com">Acura</a> is my favorite car.
+
+ <%
+ }
+ }
+ %>
+</body>
+</html>
+
diff --git a/tomcat-uid/webapps/examples/jsp/error/err.jsp.html b/tomcat-uid/webapps/examples/jsp/error/err.jsp.html
new file mode 100644
index 0000000..65b5654
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/error/err.jsp.html
@@ -0,0 +1,46 @@
+<html><body><pre>
+<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.
+-->
+<body bgcolor="lightblue">
+
+ <%@ page errorPage="errorpge.jsp" %>
+ <jsp:useBean id="foo" scope="request" class="error.Smart" />
+ <%
+ String name = null;
+
+ if (request.getParameter("name") == null) {
+ %>
+ <%@ include file="error.html" %>
+ <%
+ } else {
+ foo.setName(request.getParameter("name"));
+ if (foo.getName().equalsIgnoreCase("integra"))
+ name = "acura";
+ if (name.equalsIgnoreCase("acura")) {
+ %>
+
+ <H1> Yes!!! <a href="http://www.acura.com">Acura</a> is my favorite car.
+
+ <%
+ }
+ }
+ %>
+</body>
+</html>
+
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/error/error.html b/tomcat-uid/webapps/examples/jsp/error/error.html
new file mode 100644
index 0000000..635346f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/error/error.html
@@ -0,0 +1,37 @@
+<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.
+-->
+
+<body bgcolor="white">
+
+<h1> This example uses <b>errorpage</b> directive </h1>
+<br>
+<h3> Select my favourite car.</h3>
+<form method=get action=err.jsp>
+<!-- <br> Make a guess: -->
+<SELECT NAME="name" SIZE=5>
+<OPTION VALUE="integra"> Acura Integra <BR>
+<OPTION VALUE="bmw328i"> BMW 328I <BR>
+<OPTION VALUE="z3"> BMW Z3 <BR>
+<OPTION VALUE="infiniti"> InfinitiQ3 <BR>
+<OPTION VALUE="audi"> Audi A8 <BR>
+</SELECT>
+<br> <INPUT TYPE=submit name=submit Value="Submit">
+</form>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/error/errorpge.jsp b/tomcat-uid/webapps/examples/jsp/error/errorpge.jsp
new file mode 100644
index 0000000..113c204
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/error/errorpge.jsp
@@ -0,0 +1,25 @@
+<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.
+-->
+
+<body bgcolor="red">
+
+ <%@ page isErrorPage="true" %>
+ <h1> The exception <%= exception.getMessage() %> tells me you
+ made a wrong choice.
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/error/errorpge.jsp.html b/tomcat-uid/webapps/examples/jsp/error/errorpge.jsp.html
new file mode 100644
index 0000000..69bf244
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/error/errorpge.jsp.html
@@ -0,0 +1,27 @@
+<html><body><pre>
+<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.
+-->
+
+<body bgcolor="red">
+
+ <%@ page isErrorPage="true" %>
+ <h1> The exception <%= exception.getMessage() %> tells me you
+ made a wrong choice.
+</body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/forward/forward.jsp b/tomcat-uid/webapps/examples/jsp/forward/forward.jsp
new file mode 100644
index 0000000..8e2ceab
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/forward/forward.jsp
@@ -0,0 +1,34 @@
+<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.
+-->
+
+<%
+ double freeMem = Runtime.getRuntime().freeMemory();
+ double totlMem = Runtime.getRuntime().totalMemory();
+ double percent = freeMem/totlMem;
+ if (percent < 0.5) {
+%>
+
+<jsp:forward page="one.jsp"/>
+
+<% } else { %>
+
+<jsp:forward page="two.html"/>
+
+<% } %>
+
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/forward/forward.jsp.html b/tomcat-uid/webapps/examples/jsp/forward/forward.jsp.html
new file mode 100644
index 0000000..9f0a563
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/forward/forward.jsp.html
@@ -0,0 +1,36 @@
+<html><body><pre>
+<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.
+-->
+
+<%
+ double freeMem = Runtime.getRuntime().freeMemory();
+ double totlMem = Runtime.getRuntime().totalMemory();
+ double percent = freeMem/totlMem;
+ if (percent < 0.5) {
+%>
+
+<jsp:forward page="one.jsp"/>
+
+<% } else { %>
+
+<jsp:forward page="two.html"/>
+
+<% } %>
+
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/forward/fwd.html b/tomcat-uid/webapps/examples/jsp/forward/fwd.html
new file mode 100644
index 0000000..e4a701e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/forward/fwd.html
@@ -0,0 +1,30 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="forward.jsp"><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><a href="forward.jsp.html">Source Code for Forward Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/forward/one.jsp b/tomcat-uid/webapps/examples/jsp/forward/one.jsp
new file mode 100644
index 0000000..90297b7
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/forward/one.jsp
@@ -0,0 +1,23 @@
+<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.
+-->
+
+<body bgcolor="white">
+<font color="red">
+
+VM Memory usage < 50%.
+</html>
\ No newline at end of file
diff --git a/tomcat-uid/webapps/examples/jsp/forward/one.jsp.html b/tomcat-uid/webapps/examples/jsp/forward/one.jsp.html
new file mode 100644
index 0000000..7cb77a0
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/forward/one.jsp.html
@@ -0,0 +1,25 @@
+<html><body><pre>
+<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.
+-->
+
+<body bgcolor="white">
+<font color="red">
+
+VM Memory usage < 50%.
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/forward/two.html b/tomcat-uid/webapps/examples/jsp/forward/two.html
new file mode 100644
index 0000000..4bc9402
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/forward/two.html
@@ -0,0 +1,23 @@
+<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.
+-->
+
+<body bgcolor="white">
+<font color="red">
+
+VM Memory usage > 50%.
+</html>
\ No newline at end of file
diff --git a/tomcat-uid/webapps/examples/jsp/images/code.gif b/tomcat-uid/webapps/examples/jsp/images/code.gif
new file mode 100644
index 0000000..93af2cd
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/images/code.gif
Binary files differ
diff --git a/tomcat-uid/webapps/examples/jsp/images/execute.gif b/tomcat-uid/webapps/examples/jsp/images/execute.gif
new file mode 100644
index 0000000..f64d70f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/images/execute.gif
Binary files differ
diff --git a/tomcat-uid/webapps/examples/jsp/images/read.gif b/tomcat-uid/webapps/examples/jsp/images/read.gif
new file mode 100644
index 0000000..66cb4e9
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/images/read.gif
Binary files differ
diff --git a/tomcat-uid/webapps/examples/jsp/images/return.gif b/tomcat-uid/webapps/examples/jsp/images/return.gif
new file mode 100644
index 0000000..af4f68f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/images/return.gif
Binary files differ
diff --git a/tomcat-uid/webapps/examples/jsp/include/foo.html b/tomcat-uid/webapps/examples/jsp/include/foo.html
new file mode 100644
index 0000000..11acc0e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/include/foo.html
@@ -0,0 +1,17 @@
+<!--
+ 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.
+-->
+To get the current time in ms
diff --git a/tomcat-uid/webapps/examples/jsp/include/foo.jsp b/tomcat-uid/webapps/examples/jsp/include/foo.jsp
new file mode 100644
index 0000000..ce4101b
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/include/foo.jsp
@@ -0,0 +1,21 @@
+<!--
+ 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.
+-->
+
+<body bgcolor="white">
+<font color="red">
+
+<%= System.currentTimeMillis() %>
diff --git a/tomcat-uid/webapps/examples/jsp/include/foo.jsp.html b/tomcat-uid/webapps/examples/jsp/include/foo.jsp.html
new file mode 100644
index 0000000..638d41d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/include/foo.jsp.html
@@ -0,0 +1,23 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+
+<body bgcolor="white">
+<font color="red">
+
+<%= System.currentTimeMillis() %>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/include/inc.html b/tomcat-uid/webapps/examples/jsp/include/inc.html
new file mode 100644
index 0000000..d2971bb
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/include/inc.html
@@ -0,0 +1,30 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="include.jsp"><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><a href="include.jsp.html">Source Code for Include Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/include/include.jsp b/tomcat-uid/webapps/examples/jsp/include/include.jsp
new file mode 100644
index 0000000..34fd6c3
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/include/include.jsp
@@ -0,0 +1,35 @@
+<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.
+-->
+
+<body bgcolor="white">
+
+<font color="red">
+
+<%@ page buffer="5kb" autoFlush="false" %>
+
+<p>In place evaluation of another JSP which gives you the current time:
+
+<%@ include file="foo.jsp" %>
+
+<p> <jsp:include page="foo.html" flush="true"/> by including the output of another JSP:
+
+<jsp:include page="foo.jsp" flush="true"/>
+
+:-)
+
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/include/include.jsp.html b/tomcat-uid/webapps/examples/jsp/include/include.jsp.html
new file mode 100644
index 0000000..f45c300
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/include/include.jsp.html
@@ -0,0 +1,37 @@
+<html><body><pre>
+<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.
+-->
+
+<body bgcolor="white">
+
+<font color="red">
+
+<%@ page buffer="5kb" autoFlush="false" %>
+
+<p>In place evaluation of another JSP which gives you the current time:
+
+<%@ include file="foo.jsp" %>
+
+<p> <jsp:include page="foo.html" flush="true"/> by including the output of another JSP:
+
+<jsp:include page="foo.jsp" flush="true"/>
+
+:-)
+
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/index.html b/tomcat-uid/webapps/examples/jsp/index.html
new file mode 100644
index 0000000..c41acf2
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/index.html
@@ -0,0 +1,370 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<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>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (WinNT; I) [Netscape]">
+ <meta name="Author" content="Anil K. Vijendran">
+ <title>JSP Examples</title>
+</head>
+<body bgcolor="#FFFFFF">
+<b><font face="Arial, Helvetica, sans-serif"><font size=+2>JSP
+Samples</font></font></b>
+<p>This is a collection of samples demonstrating the usage of different
+parts of the Java Server Pages (JSP) specification. Both JSP 2.0 and
+JSP 1.2 examples are presented below.
+<p>These examples will only work when these pages are being served by a
+servlet engine; of course, we recommend
+<a href="http://tomcat.apache.org/">Tomcat</a>.
+They will not work if you are viewing these pages via a
+"file://..." URL.
+<p>To navigate your way through the examples, the following icons will
+help:
+<br>
+<table BORDER=0 CELLSPACING=5 WIDTH="85%" >
+<tr VALIGN=TOP>
+<td WIDTH="30"><img SRC="images/execute.gif" ></td>
+
+<td>Execute the example</td>
+</tr>
+
+<tr VALIGN=TOP>
+<td WIDTH="30"><img SRC="images/code.gif" height=24 width=24></td>
+
+<td>Look at the source code for the example</td>
+</tr>
+
+<!--<tr VALIGN=TOP>
+<td WIDTH="30"><img SRC="images/read.gif" height=24 width=24></td>
+
+<td>Read more about this feature</td>
+-->
+
+</tr>
+<tr VALIGN=TOP>
+<td WIDTH="30"><img SRC="images/return.gif" height=24 width=24></td>
+
+<td>Return to this screen</td>
+</tr>
+</table>
+
+<p>Tip: For session scoped beans to work, the cookies must be enabled.
+This can be done using browser options.
+<br>
+<br>
+<b><u><font size="+1">JSP 2.0 Examples</font></u></b><br>
+
+<table BORDER=0 CELLSPACING=5 WIDTH="85%" >
+<tr valign=TOP>
+<td><b>Expression Language</b></td>
+</tr>
+
+<tr valign=TOP>
+<td>Basic Arithmetic</td>
+<td valign=TOP width="30%"><a href="jsp2/el/basic-arithmetic.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/el/basic-arithmetic.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/el/basic-arithmetic.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/el/basic-arithmetic.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td>Basic Comparisons</td>
+<td valign=TOP width="30%"><a href="jsp2/el/basic-comparisons.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/el/basic-comparisons.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/el/basic-comparisons.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/el/basic-comparisons.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td>Implicit Objects</td>
+<td valign=TOP width="30%"><a href="jsp2/el/implicit-objects.jsp?foo=bar"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/el/implicit-objects.jsp?foo=bar">Execute</a></td>
+
+<td width="30%"><a href="jsp2/el/implicit-objects.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/el/implicit-objects.html">Source</a></td>
+</tr>
+<tr valign=TOP>
+
+<td>Functions</td>
+<td valign=TOP width="30%"><a href="jsp2/el/functions.jsp?foo=JSP+2.0"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/el/functions.jsp?foo=JSP+2.0">Execute</a></td>
+
+<td width="30%"><a href="jsp2/el/functions.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/el/functions.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td><br><b>SimpleTag Handlers and JSP Fragments</b></td>
+</tr>
+
+<tr valign=TOP>
+<td>Hello World Tag</td>
+<td valign=TOP width="30%"><a href="jsp2/simpletag/hello.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/simpletag/hello.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/simpletag/hello.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/simpletag/hello.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td>Repeat Tag</td>
+<td valign=TOP width="30%"><a href="jsp2/simpletag/repeat.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/simpletag/repeat.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/simpletag/repeat.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/simpletag/repeat.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td>Book Example</td>
+<td valign=TOP width="30%"><a href="jsp2/simpletag/book.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/simpletag/book.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/simpletag/book.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/simpletag/book.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td><br><b>Tag Files</b></td>
+</tr>
+
+<tr valign=TOP>
+<td>Hello World Tag File</td>
+<td valign=TOP width="30%"><a href="jsp2/tagfiles/hello.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/tagfiles/hello.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/tagfiles/hello.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/tagfiles/hello.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td>Panel Tag File</td>
+<td valign=TOP width="30%"><a href="jsp2/tagfiles/panel.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/tagfiles/panel.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/tagfiles/panel.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/tagfiles/panel.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td>Display Products Example</td>
+<td valign=TOP width="30%"><a href="jsp2/tagfiles/products.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/tagfiles/products.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/tagfiles/products.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/tagfiles/products.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td><br><b>New JSP XML Syntax (.jspx)</b></td>
+</tr>
+
+<tr valign=TOP>
+<td>XHTML Basic Example</td>
+<td valign=TOP width="30%"><a href="jsp2/jspx/basic.jspx"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/jspx/basic.jspx">Execute</a></td>
+
+<td width="30%"><a href="jsp2/jspx/basic.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/jspx/basic.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td>SVG (Scalable Vector Graphics)</td>
+<td valign=TOP width="30%"><a href="jsp2/jspx/svgexample.html"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/jspx/svgexample.html">Execute</a></td>
+
+<td width="30%"><a href="jsp2/jspx/textRotate.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/jspx/textRotate.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td><br><b>Other JSP 2.0 Features</b></td>
+</tr>
+
+<tr valign=TOP>
+<td><jsp:attribute> and <jsp:body></td>
+<td valign=TOP width="30%"><a href="jsp2/jspattribute/jspattribute.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/jspattribute/jspattribute.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/jspattribute/jspattribute.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/jspattribute/jspattribute.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td>Shuffle Example</td>
+<td valign=TOP width="30%"><a href="jsp2/jspattribute/shuffle.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/jspattribute/shuffle.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/jspattribute/shuffle.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/jspattribute/shuffle.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td>Attributes With Dynamic Names</td>
+<td valign=TOP width="30%"><a href="jsp2/misc/dynamicattrs.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/misc/dynamicattrs.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/misc/dynamicattrs.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/misc/dynamicattrs.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td>JSP Configuration</td>
+<td valign=TOP width="30%"><a href="jsp2/misc/config.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="jsp2/misc/config.jsp">Execute</a></td>
+
+<td width="30%"><a href="jsp2/misc/config.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsp2/misc/config.html">Source</a></td>
+</tr>
+
+</table>
+
+<br>
+<b><u><font size="+1">JSP 1.2 Examples</font></u></b><br>
+<table BORDER=0 CELLSPACING=5 WIDTH="85%" >
+<tr VALIGN=TOP>
+<td>Numberguess </td>
+
+<td VALIGN=TOP WIDTH="30%"><a href="num/numguess.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="num/numguess.jsp">Execute</a></td>
+
+<td WIDTH="30%"><a href="num/numguess.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="num/numguess.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Date </td>
+
+<td VALIGN=TOP WIDTH="30%"><a href="dates/date.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="dates/date.jsp">Execute</a></td>
+
+<td WIDTH="30%"><a href="dates/date.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="dates/date.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Snoop</td>
+
+<td WIDTH="30%"><a href="snp/snoop.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="snp/snoop.jsp">Execute</a></td>
+
+<td WIDTH="30%"><a href="snp/snoop.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="snp/snoop.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>ErrorPage </td>
+
+<td WIDTH="30%"><a href="error/error.html"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="error/error.html">Execute</a></td>
+
+<td WIDTH="30%"><a href="error/er.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="error/er.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Carts </td>
+
+<td VALIGN=TOP WIDTH="30%"><a href="sessions/carts.html"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="sessions/carts.html">Execute</a></td>
+
+<td WIDTH="30%"><a href="sessions/crt.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="sessions/crt.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Checkbox </td>
+
+<td VALIGN=TOP WIDTH="30%"><a href="checkbox/check.html"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="checkbox/check.html">Execute</a></td>
+
+<td WIDTH="30%"><a href="checkbox/cresult.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="checkbox/cresult.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Color </td>
+
+<td VALIGN=TOP WIDTH="30%"><a href="colors/colors.html"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="colors/colors.html">Execute</a></td>
+
+<td WIDTH="30%"><a href="colors/clr.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="colors/clr.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Calendar </td>
+
+<td WIDTH="30%"><a href="cal/login.html"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="cal/login.html">Execute</a></td>
+
+<td WIDTH="30%"><a href="cal/calendar.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="cal/calendar.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Include </td>
+
+<td VALIGN=TOP WIDTH="30%"><a href="include/include.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="include/include.jsp">Execute</a></td>
+
+<td WIDTH="30%"><a href="include/inc.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="include/inc.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Forward </td>
+
+<td VALIGN=TOP WIDTH="30%"><a href="forward/forward.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="forward/forward.jsp">Execute</a></td>
+
+<td WIDTH="30%"><a href="forward/fwd.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="forward/fwd.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Plugin </td>
+
+<td VALIGN=TOP WIDTH="30%"><a href="plugin/plugin.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="plugin/plugin.jsp">Execute</a></td>
+
+<td WIDTH="30%"><a href="plugin/plugin.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="plugin/plugin.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>JSP-Servlet-JSP </td>
+
+<td VALIGN=TOP WIDTH="30%"><a href="jsptoserv/jsptoservlet.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="jsptoserv/jsptoservlet.jsp">Execute</a></td>
+
+<td WIDTH="30%"><a href="jsptoserv/jts.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="jsptoserv/jts.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Custom tag example</td>
+
+<td VALIGN=TOP WIDTH="30%"><a href="simpletag/foo.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="simpletag/foo.jsp">Execute</a></td>
+
+<td WIDTH="30%"><a href="simpletag/foo.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="simpletag/foo.html">Source</a></td>
+</tr>
+
+<tr valign=TOP>
+<td>XML syntax example</td>
+<td valign=TOP width="30%"><a href="xml/xml.jsp"><img src="images/execute.gif" hspace=4 border=0 align=top></a><a href="xml/xml.jsp">Execute</a></td>
+
+<td width="30%"><a href="xml/xml.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="xml/xml.html">Source</a></td>
+</tr>
+
+</table>
+
+<br/>
+<b><u><font size="+1">Tag Plugins</font></u></b><br>
+<table BORDER=0 CELLSPACING=5 WIDTH="85%" >
+
+<tr VALIGN=TOP>
+ <td>If </td>
+ <td VALIGN=TOP WIDTH="30%">
+ <a href="tagplugin/if.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0
+align=TOP></a>
+ <a href="tagplugin/if.jsp">Execute</a>
+ </td>
+ <td WIDTH="30%">
+ <a href="tagplugin/if.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 hei
+ght=24 width=24 align=TOP></a>
+ <a href="tagplugin/if.html">Source</a>
+ </td>
+</tr>
+
+<tr VALIGN=TOP>
+ <td>ForEach </td>
+ <td VALIGN=TOP WIDTH="30%">
+ <a href="tagplugin/foreach.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0
+align=TOP></a>
+ <a href="tagplugin/foreach.jsp">Execute</a>
+ </td>
+ <td WIDTH="30%">
+ <a href="tagplugin/foreach.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 hei
+ght=24 width=24 align=TOP></a>
+ <a href="tagplugin/foreach.html">Source</a>
+ </td>
+</tr>
+
+<tr VALIGN=TOP>
+ <td>Choose </td>
+ <td VALIGN=TOP WIDTH="30%">
+ <a href="tagplugin/choose.jsp"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a>
+ <a href="tagplugin/choose.jsp">Execute</a>
+ </td>
+ <td WIDTH="30%">
+ <a href="tagplugin/choose.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a>
+ <a href="tagplugin/choose.html">Source</a>
+ </td>
+</tr>
+
+</table>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/Functions.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/el/Functions.java.html
new file mode 100644
index 0000000..350fce6
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/Functions.java.html
@@ -0,0 +1,45 @@
+<html><body><pre>
+/*
+* 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.
+*/
+package jsp2.examples.el;
+
+/**
+ * Defines the functions for the jsp2 example tag library.
+ *
+ * <p>Each function is defined as a static method.</p>
+ */
+public class Functions {
+ public static String reverse( String text ) {
+ return new StringBuffer( text ).reverse().toString();
+ }
+
+ public static int numVowels( String text ) {
+ String vowels = "aeiouAEIOU";
+ int result = 0;
+ for( int i = 0; i < text.length(); i++ ) {
+ if( vowels.indexOf( text.charAt( i ) ) != -1 ) {
+ result++;
+ }
+ }
+ return result;
+ }
+
+ public static String caps( String text ) {
+ return text.toUpperCase();
+ }
+}
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-arithmetic.html b/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-arithmetic.html
new file mode 100644
index 0000000..ca88b7f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-arithmetic.html
@@ -0,0 +1,30 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="basic-arithmetic.jsp"><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><a href="basic-arithmetic.jsp.html">Source Code for Basic Arithmetic Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp
new file mode 100644
index 0000000..e2ec74c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp
@@ -0,0 +1,88 @@
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>JSP 2.0 Expression Language - Basic Arithmetic</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Expression Language - Basic Arithmetic</h1>
+ <hr>
+ This example illustrates basic Expression Language arithmetic.
+ Addition (+), subtraction (-), multiplication (*), division (/ or div),
+ and modulus (% or mod) are all supported. Error conditions, like
+ division by zero, are handled gracefully.
+ <br>
+ <blockquote>
+ <code>
+ <table border="1">
+ <thead>
+ <td><b>EL Expression</b></td>
+ <td><b>Result</b></td>
+ </thead>
+ <tr>
+ <td>\${1}</td>
+ <td>${1}</td>
+ </tr>
+ <tr>
+ <td>\${1 + 2}</td>
+ <td>${1 + 2}</td>
+ </tr>
+ <tr>
+ <td>\${1.2 + 2.3}</td>
+ <td>${1.2 + 2.3}</td>
+ </tr>
+ <tr>
+ <td>\${1.2E4 + 1.4}</td>
+ <td>${1.2E4 + 1.4}</td>
+ </tr>
+ <tr>
+ <td>\${-4 - 2}</td>
+ <td>${-4 - 2}</td>
+ </tr>
+ <tr>
+ <td>\${21 * 2}</td>
+ <td>${21 * 2}</td>
+ </tr>
+ <tr>
+ <td>\${3/4}</td>
+ <td>${3/4}</td>
+ </tr>
+ <tr>
+ <td>\${3 div 4}</td>
+ <td>${3 div 4}</td>
+ </tr>
+ <tr>
+ <td>\${3/0}</td>
+ <td>${3/0}</td>
+ </tr>
+ <tr>
+ <td>\${10%4}</td>
+ <td>${10%4}</td>
+ </tr>
+ <tr>
+ <td>\${10 mod 4}</td>
+ <td>${10 mod 4}</td>
+ </tr>
+ <tr>
+ <td>\${(1==2) ? 3 : 4}</td>
+ <td>${(1==2) ? 3 : 4}</td>
+ </tr>
+ </table>
+ </code>
+ </blockquote>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp.html
new file mode 100644
index 0000000..4aa05c8
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-arithmetic.jsp.html
@@ -0,0 +1,90 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>JSP 2.0 Expression Language - Basic Arithmetic</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Expression Language - Basic Arithmetic</h1>
+ <hr>
+ This example illustrates basic Expression Language arithmetic.
+ Addition (+), subtraction (-), multiplication (*), division (/ or div),
+ and modulus (% or mod) are all supported. Error conditions, like
+ division by zero, are handled gracefully.
+ <br>
+ <blockquote>
+ <code>
+ <table border="1">
+ <thead>
+ <td><b>EL Expression</b></td>
+ <td><b>Result</b></td>
+ </thead>
+ <tr>
+ <td>\${1}</td>
+ <td>${1}</td>
+ </tr>
+ <tr>
+ <td>\${1 + 2}</td>
+ <td>${1 + 2}</td>
+ </tr>
+ <tr>
+ <td>\${1.2 + 2.3}</td>
+ <td>${1.2 + 2.3}</td>
+ </tr>
+ <tr>
+ <td>\${1.2E4 + 1.4}</td>
+ <td>${1.2E4 + 1.4}</td>
+ </tr>
+ <tr>
+ <td>\${-4 - 2}</td>
+ <td>${-4 - 2}</td>
+ </tr>
+ <tr>
+ <td>\${21 * 2}</td>
+ <td>${21 * 2}</td>
+ </tr>
+ <tr>
+ <td>\${3/4}</td>
+ <td>${3/4}</td>
+ </tr>
+ <tr>
+ <td>\${3 div 4}</td>
+ <td>${3 div 4}</td>
+ </tr>
+ <tr>
+ <td>\${3/0}</td>
+ <td>${3/0}</td>
+ </tr>
+ <tr>
+ <td>\${10%4}</td>
+ <td>${10%4}</td>
+ </tr>
+ <tr>
+ <td>\${10 mod 4}</td>
+ <td>${10 mod 4}</td>
+ </tr>
+ <tr>
+ <td>\${(1==2) ? 3 : 4}</td>
+ <td>${(1==2) ? 3 : 4}</td>
+ </tr>
+ </table>
+ </code>
+ </blockquote>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-comparisons.html b/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-comparisons.html
new file mode 100644
index 0000000..0102232
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-comparisons.html
@@ -0,0 +1,30 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="basic-comparisons.jsp"><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><a href="basic-comparisons.jsp.html">Source Code for Basic Comparisons Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp
new file mode 100644
index 0000000..e01188a
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp
@@ -0,0 +1,116 @@
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>JSP 2.0 Expression Language - Basic Comparisons</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Expression Language - Basic Comparisons</h1>
+ <hr>
+ This example illustrates basic Expression Language comparisons.
+ The following comparison operators are supported:
+ <ul>
+ <li>Less-than (< or lt)</li>
+ <li>Greater-than (> or gt)</li>
+ <li>Less-than-or-equal (<= or le)</li>
+ <li>Greater-than-or-equal (>= or ge)</li>
+ <li>Equal (== or eq)</li>
+ <li>Not Equal (!= or ne)</li>
+ </ul>
+ <blockquote>
+ <u><b>Numeric</b></u>
+ <code>
+ <table border="1">
+ <thead>
+ <td><b>EL Expression</b></td>
+ <td><b>Result</b></td>
+ </thead>
+ <tr>
+ <td>\${1 < 2}</td>
+ <td>${1 < 2}</td>
+ </tr>
+ <tr>
+ <td>\${1 lt 2}</td>
+ <td>${1 lt 2}</td>
+ </tr>
+ <tr>
+ <td>\${1 > (4/2)}</td>
+ <td>${1 > (4/2)}</td>
+ </tr>
+ <tr>
+ <td>\${1 gt (4/2)}</td>
+ <td>${1 gt (4/2)}</td>
+ </tr>
+ <tr>
+ <td>\${4.0 >= 3}</td>
+ <td>${4.0 >= 3}</td>
+ </tr>
+ <tr>
+ <td>\${4.0 ge 3}</td>
+ <td>${4.0 ge 3}</td>
+ </tr>
+ <tr>
+ <td>\${4 <= 3}</td>
+ <td>${4 <= 3}</td>
+ </tr>
+ <tr>
+ <td>\${4 le 3}</td>
+ <td>${4 le 3}</td>
+ </tr>
+ <tr>
+ <td>\${100.0 == 100}</td>
+ <td>${100.0 == 100}</td>
+ </tr>
+ <tr>
+ <td>\${100.0 eq 100}</td>
+ <td>${100.0 eq 100}</td>
+ </tr>
+ <tr>
+ <td>\${(10*10) != 100}</td>
+ <td>${(10*10) != 100}</td>
+ </tr>
+ <tr>
+ <td>\${(10*10) ne 100}</td>
+ <td>${(10*10) ne 100}</td>
+ </tr>
+ </table>
+ </code>
+ <br>
+ <u><b>Alphabetic</b></u>
+ <code>
+ <table border="1">
+ <thead>
+ <td><b>EL Expression</b></td>
+ <td><b>Result</b></td>
+ </thead>
+ <tr>
+ <td>\${'a' < 'b'}</td>
+ <td>${'a' < 'b'}</td>
+ </tr>
+ <tr>
+ <td>\${'hip' > 'hit'}</td>
+ <td>${'hip' > 'hit'}</td>
+ </tr>
+ <tr>
+ <td>\${'4' > 3}</td>
+ <td>${'4' > 3}</td>
+ </tr>
+ </table>
+ </code>
+ </blockquote>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp.html
new file mode 100644
index 0000000..efc4da3
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/basic-comparisons.jsp.html
@@ -0,0 +1,118 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>JSP 2.0 Expression Language - Basic Comparisons</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Expression Language - Basic Comparisons</h1>
+ <hr>
+ This example illustrates basic Expression Language comparisons.
+ The following comparison operators are supported:
+ <ul>
+ <li>Less-than (&lt; or lt)</li>
+ <li>Greater-than (&gt; or gt)</li>
+ <li>Less-than-or-equal (&lt;= or le)</li>
+ <li>Greater-than-or-equal (&gt;= or ge)</li>
+ <li>Equal (== or eq)</li>
+ <li>Not Equal (!= or ne)</li>
+ </ul>
+ <blockquote>
+ <u><b>Numeric</b></u>
+ <code>
+ <table border="1">
+ <thead>
+ <td><b>EL Expression</b></td>
+ <td><b>Result</b></td>
+ </thead>
+ <tr>
+ <td>\${1 &lt; 2}</td>
+ <td>${1 < 2}</td>
+ </tr>
+ <tr>
+ <td>\${1 lt 2}</td>
+ <td>${1 lt 2}</td>
+ </tr>
+ <tr>
+ <td>\${1 &gt; (4/2)}</td>
+ <td>${1 > (4/2)}</td>
+ </tr>
+ <tr>
+ <td>\${1 gt (4/2)}</td>
+ <td>${1 gt (4/2)}</td>
+ </tr>
+ <tr>
+ <td>\${4.0 &gt;= 3}</td>
+ <td>${4.0 >= 3}</td>
+ </tr>
+ <tr>
+ <td>\${4.0 ge 3}</td>
+ <td>${4.0 ge 3}</td>
+ </tr>
+ <tr>
+ <td>\${4 &lt;= 3}</td>
+ <td>${4 <= 3}</td>
+ </tr>
+ <tr>
+ <td>\${4 le 3}</td>
+ <td>${4 le 3}</td>
+ </tr>
+ <tr>
+ <td>\${100.0 == 100}</td>
+ <td>${100.0 == 100}</td>
+ </tr>
+ <tr>
+ <td>\${100.0 eq 100}</td>
+ <td>${100.0 eq 100}</td>
+ </tr>
+ <tr>
+ <td>\${(10*10) != 100}</td>
+ <td>${(10*10) != 100}</td>
+ </tr>
+ <tr>
+ <td>\${(10*10) ne 100}</td>
+ <td>${(10*10) ne 100}</td>
+ </tr>
+ </table>
+ </code>
+ <br>
+ <u><b>Alphabetic</b></u>
+ <code>
+ <table border="1">
+ <thead>
+ <td><b>EL Expression</b></td>
+ <td><b>Result</b></td>
+ </thead>
+ <tr>
+ <td>\${'a' &lt; 'b'}</td>
+ <td>${'a' < 'b'}</td>
+ </tr>
+ <tr>
+ <td>\${'hip' &gt; 'hit'}</td>
+ <td>${'hip' > 'hit'}</td>
+ </tr>
+ <tr>
+ <td>\${'4' &gt; 3}</td>
+ <td>${'4' > 3}</td>
+ </tr>
+ </table>
+ </code>
+ </blockquote>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/functions.html b/tomcat-uid/webapps/examples/jsp/jsp2/el/functions.html
new file mode 100644
index 0000000..0fdb080
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/functions.html
@@ -0,0 +1,32 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="functions.jsp?foo=JSP+2.0"><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><a href="functions.jsp.html">Source Code for functions.jsp<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="Functions.java.html">Source Code for Functions.java<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/functions.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/el/functions.jsp
new file mode 100644
index 0000000..66478c0
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/functions.jsp
@@ -0,0 +1,66 @@
+<!--
+ 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.
+-->
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%@ taglib prefix="my" uri="http://tomcat.apache.org/jsp2-example-taglib"%>
+
+<html>
+ <head>
+ <title>JSP 2.0 Expression Language - Functions</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Expression Language - Functions</h1>
+ <hr>
+ An upgrade from the JSTL expression language, the JSP 2.0 EL also
+ allows for simple function invocation. Functions are defined
+ by tag libraries and are implemented by a Java programmer as
+ static methods.
+
+ <blockquote>
+ <u><b>Change Parameter</b></u>
+ <form action="functions.jsp" method="GET">
+ foo = <input type="text" name="foo" value="${fn:escapeXml(param["foo"])}">
+ <input type="submit">
+ </form>
+ <br>
+ <code>
+ <table border="1">
+ <thead>
+ <td><b>EL Expression</b></td>
+ <td><b>Result</b></td>
+ </thead>
+ <tr>
+ <td>\${param["foo"]}</td>
+ <td>${fn:escapeXml(param["foo"])} </td>
+ </tr>
+ <tr>
+ <td>\${my:reverse(param["foo"])}</td>
+ <td>${my:reverse(fn:escapeXml(param["foo"]))} </td>
+ </tr>
+ <tr>
+ <td>\${my:reverse(my:reverse(param["foo"]))}</td>
+ <td>${my:reverse(my:reverse(fn:escapeXml(param["foo"])))} </td>
+ </tr>
+ <tr>
+ <td>\${my:countVowels(param["foo"])}</td>
+ <td>${my:countVowels(fn:escapeXml(param["foo"]))} </td>
+ </tr>
+ </table>
+ </code>
+ </blockquote>
+ </body>
+</html>
+
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/functions.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/el/functions.jsp.html
new file mode 100644
index 0000000..9ac0c79
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/functions.jsp.html
@@ -0,0 +1,68 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%@ taglib prefix="my" uri="http://tomcat.apache.org/jsp2-example-taglib"%>
+
+<html>
+ <head>
+ <title>JSP 2.0 Expression Language - Functions</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Expression Language - Functions</h1>
+ <hr>
+ An upgrade from the JSTL expression language, the JSP 2.0 EL also
+ allows for simple function invocation. Functions are defined
+ by tag libraries and are implemented by a Java programmer as
+ static methods.
+
+ <blockquote>
+ <u><b>Change Parameter</b></u>
+ <form action="functions.jsp" method="GET">
+ foo = <input type="text" name="foo" value="${fn:escapeXml(param["foo"])}">
+ <input type="submit">
+ </form>
+ <br>
+ <code>
+ <table border="1">
+ <thead>
+ <td><b>EL Expression</b></td>
+ <td><b>Result</b></td>
+ </thead>
+ <tr>
+ <td>\${param["foo"]}</td>
+ <td>${fn:escapeXml(param["foo"])}&nbsp;</td>
+ </tr>
+ <tr>
+ <td>\${my:reverse(param["foo"])}</td>
+ <td>${my:reverse(fn:escapeXml(param["foo"]))}&nbsp;</td>
+ </tr>
+ <tr>
+ <td>\${my:reverse(my:reverse(param["foo"]))}</td>
+ <td>${my:reverse(my:reverse(fn:escapeXml(param["foo"])))}&nbsp;</td>
+ </tr>
+ <tr>
+ <td>\${my:countVowels(param["foo"])}</td>
+ <td>${my:countVowels(fn:escapeXml(param["foo"]))}&nbsp;</td>
+ </tr>
+ </table>
+ </code>
+ </blockquote>
+ </body>
+</html>
+
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/implicit-objects.html b/tomcat-uid/webapps/examples/jsp/jsp2/el/implicit-objects.html
new file mode 100644
index 0000000..2046603
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/implicit-objects.html
@@ -0,0 +1,31 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="implicit-objects.jsp?foo=bar"><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><a href="implicit-objects.jsp.html">Source Code for Implicit Objects Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/implicit-objects.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/el/implicit-objects.jsp
new file mode 100644
index 0000000..8d6841a
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/implicit-objects.jsp
@@ -0,0 +1,89 @@
+<!--
+ 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.
+-->
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+
+<html>
+ <head>
+ <title>JSP 2.0 Expression Language - Implicit Objects</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Expression Language - Implicit Objects</h1>
+ <hr>
+ This example illustrates some of the implicit objects available
+ in the Expression Lanaguage. The following implicit objects are
+ available (not all illustrated here):
+ <ul>
+ <li>pageContext - the PageContext object</li>
+ <li>pageScope - a Map that maps page-scoped attribute names to
+ their values</li>
+ <li>requestScope - a Map that maps request-scoped attribute names
+ to their values</li>
+ <li>sessionScope - a Map that maps session-scoped attribute names
+ to their values</li>
+ <li>applicationScope - a Map that maps application-scoped attribute
+ names to their values</li>
+ <li>param - a Map that maps parameter names to a single String
+ parameter value</li>
+ <li>paramValues - a Map that maps parameter names to a String[] of
+ all values for that parameter</li>
+ <li>header - a Map that maps header names to a single String
+ header value</li>
+ <li>headerValues - a Map that maps header names to a String[] of
+ all values for that header</li>
+ <li>initParam - a Map that maps context initialization parameter
+ names to their String parameter value</li>
+ <li>cookie - a Map that maps cookie names to a single Cookie object.</li>
+ </ul>
+
+ <blockquote>
+ <u><b>Change Parameter</b></u>
+ <form action="implicit-objects.jsp" method="GET">
+ foo = <input type="text" name="foo" value="${fn:escapeXml(param["foo"])}">
+ <input type="submit">
+ </form>
+ <br>
+ <code>
+ <table border="1">
+ <thead>
+ <td><b>EL Expression</b></td>
+ <td><b>Result</b></td>
+ </thead>
+ <tr>
+ <td>\${param.foo}</td>
+ <td>${fn:escapeXml(param["foo"])} </td>
+ </tr>
+ <tr>
+ <td>\${param["foo"]}</td>
+ <td>${fn:escapeXml(param["foo"])} </td>
+ </tr>
+ <tr>
+ <td>\${header["host"]}</td>
+ <td>${fn:escapeXml(header["host"])} </td>
+ </tr>
+ <tr>
+ <td>\${header["accept"]}</td>
+ <td>${fn:escapeXml(header["accept"])} </td>
+ </tr>
+ <tr>
+ <td>\${header["user-agent"]}</td>
+ <td>${fn:escapeXml(header["user-agent"])} </td>
+ </tr>
+ </table>
+ </code>
+ </blockquote>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/el/implicit-objects.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/el/implicit-objects.jsp.html
new file mode 100644
index 0000000..a2d9bdc
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/el/implicit-objects.jsp.html
@@ -0,0 +1,91 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+
+<html>
+ <head>
+ <title>JSP 2.0 Expression Language - Implicit Objects</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Expression Language - Implicit Objects</h1>
+ <hr>
+ This example illustrates some of the implicit objects available
+ in the Expression Lanaguage. The following implicit objects are
+ available (not all illustrated here):
+ <ul>
+ <li>pageContext - the PageContext object</li>
+ <li>pageScope - a Map that maps page-scoped attribute names to
+ their values</li>
+ <li>requestScope - a Map that maps request-scoped attribute names
+ to their values</li>
+ <li>sessionScope - a Map that maps session-scoped attribute names
+ to their values</li>
+ <li>applicationScope - a Map that maps application-scoped attribute
+ names to their values</li>
+ <li>param - a Map that maps parameter names to a single String
+ parameter value</li>
+ <li>paramValues - a Map that maps parameter names to a String[] of
+ all values for that parameter</li>
+ <li>header - a Map that maps header names to a single String
+ header value</li>
+ <li>headerValues - a Map that maps header names to a String[] of
+ all values for that header</li>
+ <li>initParam - a Map that maps context initialization parameter
+ names to their String parameter value</li>
+ <li>cookie - a Map that maps cookie names to a single Cookie object.</li>
+ </ul>
+
+ <blockquote>
+ <u><b>Change Parameter</b></u>
+ <form action="implicit-objects.jsp" method="GET">
+ foo = <input type="text" name="foo" value="${fn:escapeXml(param["foo"])}">
+ <input type="submit">
+ </form>
+ <br>
+ <code>
+ <table border="1">
+ <thead>
+ <td><b>EL Expression</b></td>
+ <td><b>Result</b></td>
+ </thead>
+ <tr>
+ <td>\${param.foo}</td>
+ <td>${fn:escapeXml(param["foo"])}&nbsp;</td>
+ </tr>
+ <tr>
+ <td>\${param["foo"]}</td>
+ <td>${fn:escapeXml(param["foo"])}&nbsp;</td>
+ </tr>
+ <tr>
+ <td>\${header["host"]}</td>
+ <td>${fn:escapeXml(header["host"])}&nbsp;</td>
+ </tr>
+ <tr>
+ <td>\${header["accept"]}</td>
+ <td>${fn:escapeXml(header["accept"])}&nbsp;</td>
+ </tr>
+ <tr>
+ <td>\${header["user-agent"]}</td>
+ <td>${fn:escapeXml(header["user-agent"])}&nbsp;</td>
+ </tr>
+ </table>
+ </code>
+ </blockquote>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/FooBean.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/FooBean.java.html
new file mode 100644
index 0000000..0b15181
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/FooBean.java.html
@@ -0,0 +1,38 @@
+<html><body><pre>
+/*
+* 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.
+*/
+
+
+package jsp2.examples;
+
+public class FooBean {
+ private String bar;
+
+ public FooBean() {
+ bar = "Initial value";
+ }
+
+ public String getBar() {
+ return this.bar;
+ }
+
+ public void setBar(String bar) {
+ this.bar = bar;
+ }
+
+}
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/HelloWorldSimpleTag.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/HelloWorldSimpleTag.java.html
new file mode 100644
index 0000000..c409839
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/HelloWorldSimpleTag.java.html
@@ -0,0 +1,34 @@
+<html><body><pre>
+/*
+* 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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import java.io.IOException;
+
+/**
+ * SimpleTag handler that prints "Hello, world!"
+ */
+public class HelloWorldSimpleTag extends SimpleTagSupport {
+ public void doTag() throws JspException, IOException {
+ getJspContext().getOut().write( "Hello, world!" );
+ }
+}
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/ShuffleSimpleTag.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/ShuffleSimpleTag.java.html
new file mode 100644
index 0000000..1b66d06
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/ShuffleSimpleTag.java.html
@@ -0,0 +1,83 @@
+<html><body><pre>
+/*
+* 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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.JspFragment;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import java.io.IOException;
+
+/**
+ * SimpleTag handler that accepts takes three attributes of type
+ * JspFragment and invokes then in a random order.
+ */
+public class ShuffleSimpleTag extends SimpleTagSupport {
+ private JspFragment fragment1;
+ private JspFragment fragment2;
+ private JspFragment fragment3;
+
+ public void doTag() throws JspException, IOException {
+ switch( (int)(Math.random() * 6) ) {
+ case 0:
+ fragment1.invoke( null );
+ fragment2.invoke( null );
+ fragment3.invoke( null );
+ break;
+ case 1:
+ fragment1.invoke( null );
+ fragment3.invoke( null );
+ fragment2.invoke( null );
+ break;
+ case 2:
+ fragment2.invoke( null );
+ fragment1.invoke( null );
+ fragment3.invoke( null );
+ break;
+ case 3:
+ fragment2.invoke( null );
+ fragment3.invoke( null );
+ fragment1.invoke( null );
+ break;
+ case 4:
+ fragment3.invoke( null );
+ fragment1.invoke( null );
+ fragment2.invoke( null );
+ break;
+ case 5:
+ fragment3.invoke( null );
+ fragment2.invoke( null );
+ fragment1.invoke( null );
+ break;
+ }
+ }
+
+ public void setFragment1( JspFragment fragment1 ) {
+ this.fragment1 = fragment1;
+ }
+
+ public void setFragment2( JspFragment fragment2 ) {
+ this.fragment2 = fragment2;
+ }
+
+ public void setFragment3( JspFragment fragment3 ) {
+ this.fragment3 = fragment3;
+ }
+}
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/TileSimpleTag.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/TileSimpleTag.java.html
new file mode 100644
index 0000000..4453222
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/TileSimpleTag.java.html
@@ -0,0 +1,48 @@
+<html><body><pre>
+/*
+* 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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import java.io.IOException;
+
+/**
+ * Displays a tile as a single cell in a table.
+ */
+public class TileSimpleTag extends SimpleTagSupport {
+ private String color;
+ private String label;
+
+ public void doTag() throws JspException, IOException {
+ getJspContext().getOut().write(
+ "<td width=\"32\" height=\"32\" bgcolor=\"" + this.color +
+ "\"><font color=\"#ffffff\"><center>" + this.label +
+ "</center></font></td>" );
+ }
+
+ public void setColor( String color ) {
+ this.color = color;
+ }
+
+ public void setLabel( String label ) {
+ this.label = label;
+ }
+}
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.html
new file mode 100644
index 0000000..b949da9
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.html
@@ -0,0 +1,37 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="jspattribute.jsp"><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><a href="jspattribute.jsp.html">Source Code for jspattribute.jsp<font color="#0000FF"></a>
+ </font> </h3>
+
+<h3><a href="HelloWorldSimpleTag.java.html">Source Code for HelloWorldSimpleTag.java<font color="#0000FF"></a>
+ </font> </h3>
+
+<h3><a href="FooBean.java.html">Source Code for FooBean.java<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp
new file mode 100644
index 0000000..64b6d6e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp
@@ -0,0 +1,46 @@
+<!--
+ 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.
+-->
+<%@ taglib prefix="my" uri="http://tomcat.apache.org/jsp2-example-taglib"%>
+
+<html>
+ <head>
+ <title>JSP 2.0 Examples - jsp:attribute and jsp:body</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - jsp:attribute and jsp:body</h1>
+ <hr>
+ <p>The new <jsp:attribute> and <jsp:body>
+ standard actions can be used to specify the value of any standard
+ action or custom action attribute.</p>
+ <p>This example uses the <jsp:attribute>
+ standard action to use the output of a custom action invocation
+ (one that simply outputs "Hello, World!") to set the value of a
+ bean property. This would normally require an intermediary
+ step, such as using JSTL's <c:set> action.</p>
+ <br>
+ <jsp:useBean id="foo" class="jsp2.examples.FooBean">
+ Bean created! Setting foo.bar...<br>
+ <jsp:setProperty name="foo" property="bar">
+ <jsp:attribute name="value">
+ <my:helloWorld/>
+ </jsp:attribute>
+ </jsp:setProperty>
+ </jsp:useBean>
+ <br>
+ Result: ${foo.bar}
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp.html
new file mode 100644
index 0000000..eb3a927
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/jspattribute.jsp.html
@@ -0,0 +1,48 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="my" uri="http://tomcat.apache.org/jsp2-example-taglib"%>
+
+<html>
+ <head>
+ <title>JSP 2.0 Examples - jsp:attribute and jsp:body</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - jsp:attribute and jsp:body</h1>
+ <hr>
+ <p>The new &lt;jsp:attribute&gt; and &lt;jsp:body&gt;
+ standard actions can be used to specify the value of any standard
+ action or custom action attribute.</p>
+ <p>This example uses the &lt;jsp:attribute&gt;
+ standard action to use the output of a custom action invocation
+ (one that simply outputs "Hello, World!") to set the value of a
+ bean property. This would normally require an intermediary
+ step, such as using JSTL's &lt;c:set&gt; action.</p>
+ <br>
+ <jsp:useBean id="foo" class="jsp2.examples.FooBean">
+ Bean created! Setting foo.bar...<br>
+ <jsp:setProperty name="foo" property="bar">
+ <jsp:attribute name="value">
+ <my:helloWorld/>
+ </jsp:attribute>
+ </jsp:setProperty>
+ </jsp:useBean>
+ <br>
+ Result: ${foo.bar}
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.html
new file mode 100644
index 0000000..b7a4cb6
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.html
@@ -0,0 +1,37 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="shuffle.jsp"><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><a href="shuffle.jsp.html">Source Code for shuffle.jsp<font color="#0000FF"></a>
+ </font> </h3>
+
+<h3><a href="ShuffleSimpleTag.java.html">Source Code for ShuffleSimpleTag.java<font color="#0000FF"></a>
+ </font> </h3>
+
+<h3><a href="TileSimpleTag.java.html">Source Code for TileSimpleTag.java<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp
new file mode 100644
index 0000000..2a318a7
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp
@@ -0,0 +1,90 @@
+<!--
+ 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.
+-->
+<%@ taglib prefix="my" uri="http://tomcat.apache.org/jsp2-example-taglib"%>
+
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Shuffle Example</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Shuffle Example</h1>
+ <hr>
+ <p>Try reloading the page a few times. Both the rows and the columns
+ are shuffled and appear different each time.</p>
+ <p>Here's how the code works. The SimpleTag handler called
+ <my:shuffle> accepts three attributes. Each attribute is a
+ JSP Fragment, meaning it is a fragment of JSP code that can be
+ dynamically executed by the shuffle tag handler on demand. The
+ shuffle tag handler executes the three fragments in a random order.
+ To shuffle both the rows and the columns, the shuffle tag is used
+ with itself as a parameter.</p>
+ <hr>
+ <blockquote>
+ <font color="#ffffff">
+ <table>
+ <my:shuffle>
+ <jsp:attribute name="fragment1">
+ <tr>
+ <my:shuffle>
+ <jsp:attribute name="fragment1">
+ <my:tile color="#ff0000" label="A"/>
+ </jsp:attribute>
+ <jsp:attribute name="fragment2">
+ <my:tile color="#00ff00" label="B"/>
+ </jsp:attribute>
+ <jsp:attribute name="fragment3">
+ <my:tile color="#0000ff" label="C"/>
+ </jsp:attribute>
+ </my:shuffle>
+ </tr>
+ </jsp:attribute>
+ <jsp:attribute name="fragment2">
+ <tr>
+ <my:shuffle>
+ <jsp:attribute name="fragment1">
+ <my:tile color="#ff0000" label="1"/>
+ </jsp:attribute>
+ <jsp:attribute name="fragment2">
+ <my:tile color="#00ff00" label="2"/>
+ </jsp:attribute>
+ <jsp:attribute name="fragment3">
+ <my:tile color="#0000ff" label="3"/>
+ </jsp:attribute>
+ </my:shuffle>
+ </tr>
+ </jsp:attribute>
+ <jsp:attribute name="fragment3">
+ <tr>
+ <my:shuffle>
+ <jsp:attribute name="fragment1">
+ <my:tile color="#ff0000" label="!"/>
+ </jsp:attribute>
+ <jsp:attribute name="fragment2">
+ <my:tile color="#00ff00" label="@"/>
+ </jsp:attribute>
+ <jsp:attribute name="fragment3">
+ <my:tile color="#0000ff" label="#"/>
+ </jsp:attribute>
+ </my:shuffle>
+ </tr>
+ </jsp:attribute>
+ </my:shuffle>
+ </table>
+ </font>
+ </blockquote>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp.html
new file mode 100644
index 0000000..9329285
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspattribute/shuffle.jsp.html
@@ -0,0 +1,92 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="my" uri="http://tomcat.apache.org/jsp2-example-taglib"%>
+
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Shuffle Example</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Shuffle Example</h1>
+ <hr>
+ <p>Try reloading the page a few times. Both the rows and the columns
+ are shuffled and appear different each time.</p>
+ <p>Here's how the code works. The SimpleTag handler called
+ &lt;my:shuffle&gt; accepts three attributes. Each attribute is a
+ JSP Fragment, meaning it is a fragment of JSP code that can be
+ dynamically executed by the shuffle tag handler on demand. The
+ shuffle tag handler executes the three fragments in a random order.
+ To shuffle both the rows and the columns, the shuffle tag is used
+ with itself as a parameter.</p>
+ <hr>
+ <blockquote>
+ <font color="#ffffff">
+ <table>
+ <my:shuffle>
+ <jsp:attribute name="fragment1">
+ <tr>
+ <my:shuffle>
+ <jsp:attribute name="fragment1">
+ <my:tile color="#ff0000" label="A"/>
+ </jsp:attribute>
+ <jsp:attribute name="fragment2">
+ <my:tile color="#00ff00" label="B"/>
+ </jsp:attribute>
+ <jsp:attribute name="fragment3">
+ <my:tile color="#0000ff" label="C"/>
+ </jsp:attribute>
+ </my:shuffle>
+ </tr>
+ </jsp:attribute>
+ <jsp:attribute name="fragment2">
+ <tr>
+ <my:shuffle>
+ <jsp:attribute name="fragment1">
+ <my:tile color="#ff0000" label="1"/>
+ </jsp:attribute>
+ <jsp:attribute name="fragment2">
+ <my:tile color="#00ff00" label="2"/>
+ </jsp:attribute>
+ <jsp:attribute name="fragment3">
+ <my:tile color="#0000ff" label="3"/>
+ </jsp:attribute>
+ </my:shuffle>
+ </tr>
+ </jsp:attribute>
+ <jsp:attribute name="fragment3">
+ <tr>
+ <my:shuffle>
+ <jsp:attribute name="fragment1">
+ <my:tile color="#ff0000" label="!"/>
+ </jsp:attribute>
+ <jsp:attribute name="fragment2">
+ <my:tile color="#00ff00" label="@"/>
+ </jsp:attribute>
+ <jsp:attribute name="fragment3">
+ <my:tile color="#0000ff" label="#"/>
+ </jsp:attribute>
+ </my:shuffle>
+ </tr>
+ </jsp:attribute>
+ </my:shuffle>
+ </table>
+ </font>
+ </blockquote>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspx/basic.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/basic.html
new file mode 100644
index 0000000..2e58dff
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/basic.html
@@ -0,0 +1,31 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="basic.jspx"><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><a href="basic.jspx.html">Source Code for XHTML Basic Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspx/basic.jspx b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/basic.jspx
new file mode 100644
index 0000000..8a5b27d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/basic.jspx
@@ -0,0 +1,46 @@
+<!--
+ 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.
+-->
+<tags:xhtmlbasic xmlns:tags="urn:jsptagdir:/WEB-INF/tags"
+ xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
+ xmlns="http://www.w3.org/1999/xhtml">
+ <jsp:directive.page contentType="text/html" />
+ <head>
+ <title>JSPX - XHTML Basic Example</title>
+ </head>
+ <body>
+ <h1>JSPX - XHTML Basic Example</h1>
+ <hr/>
+ This example illustrates how to use JSPX to produce an XHTML basic
+ document suitable for use with mobile phones, televisions,
+ PDAs, vending machines, pagers, car navigation systems,
+ mobile game machines, digital book readers, smart watches, etc.
+ <p/>
+ JSPX lets you create dynamic documents in a pure XML syntax compatible
+ with existing XML tools. The XML syntax in JSP 1.2 was awkward and
+ required &lt;jsp:root&gt; to be the root element of the document.
+ This is no longer the case in JSP 2.0.
+ <p/>
+ This particular example uses a tag file to produce the DOCTYPE and
+ namespace declarations to make the output of this page a valid XHTML
+ Basic document.
+ <p/>
+ Just to prove this is live, here's some dynamic content:
+ <jsp:useBean id="now" class="java.util.Date" />
+ <fmt:formatDate value="${now}" pattern="MMMM d, yyyy, H:mm:ss"/>
+ </body>
+</tags:xhtmlbasic>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspx/basic.jspx.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/basic.jspx.html
new file mode 100644
index 0000000..f177334
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/basic.jspx.html
@@ -0,0 +1,48 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<tags:xhtmlbasic xmlns:tags="urn:jsptagdir:/WEB-INF/tags"
+ xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
+ xmlns="http://www.w3.org/1999/xhtml">
+ <jsp:directive.page contentType="text/html" />
+ <head>
+ <title>JSPX - XHTML Basic Example</title>
+ </head>
+ <body>
+ <h1>JSPX - XHTML Basic Example</h1>
+ <hr/>
+ This example illustrates how to use JSPX to produce an XHTML basic
+ document suitable for use with mobile phones, televisions,
+ PDAs, vending machines, pagers, car navigation systems,
+ mobile game machines, digital book readers, smart watches, etc.
+ <p/>
+ JSPX lets you create dynamic documents in a pure XML syntax compatible
+ with existing XML tools. The XML syntax in JSP 1.2 was awkward and
+ required &amp;lt;jsp:root&amp;gt; to be the root element of the document.
+ This is no longer the case in JSP 2.0.
+ <p/>
+ This particular example uses a tag file to produce the DOCTYPE and
+ namespace declarations to make the output of this page a valid XHTML
+ Basic document.
+ <p/>
+ Just to prove this is live, here's some dynamic content:
+ <jsp:useBean id="now" class="java.util.Date" />
+ <fmt:formatDate value="${now}" pattern="MMMM d, yyyy, H:mm:ss"/>
+ </body>
+</tags:xhtmlbasic>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspx/svgexample.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/svgexample.html
new file mode 100644
index 0000000..12bcd82
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/svgexample.html
@@ -0,0 +1,52 @@
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>JSP 2.0 SVG Example</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 SVG Example</h1>
+ <hr>
+ This example uses JSP 2.0's new, simplified JSPX syntax to render a
+ Scalable Vector Graphics (SVG) document. When you view the source,
+ notice the lack of a <jsp:root> element! The text to be rendered
+ can be modified by changing the value of the name parameter.
+ <p>
+ SVG has many potential uses, such as searchable images, or images
+ customized with the name of your site's visitor (e.g. a "Susan's Store"
+ tab image). JSPX is a natural fit for generating dynamic XML content
+ such as SVG.
+ <p>
+ To execute this example, follow these steps:
+ <ol>
+ <li>Download <a href="http://xmlgraphics.apache.org/batik/index.html">Apache Batik</a>,
+ or any other SVG viewer.</li>
+ <li>Copy the following URL:
+ <a href="http://localhost:8080/examples/jsp/jsp2/jspx/textRotate.jspx?name=JSPX">
+ http://localhost:8080/examples/jsp/jsp2/jspx/textRotate.jspx?name=JSPX</a>
+ </li>
+ <li>Paste the URL into Batik's Location field and press Enter</li>
+ <li>Customize by changing the name=JSPX parameter</li>
+ </ol>
+ <br>
+ The following is a screenshot of the resulting image, for those that
+ don't have an SVG viewer:
+ <blockquote>
+ <img src="textRotate.jpg" border="1">
+ </blockquote>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspx/textRotate.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/textRotate.html
new file mode 100644
index 0000000..e54588f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/textRotate.html
@@ -0,0 +1,32 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="textRotate.jspx"><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><a href="textRotate.jspx.html">Source Code for SVG (Scalable Vector Graphics)
+Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspx/textRotate.jpg b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/textRotate.jpg
new file mode 100644
index 0000000..9e98736
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/textRotate.jpg
Binary files differ
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspx/textRotate.jspx b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/textRotate.jspx
new file mode 100644
index 0000000..ad97af2
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/textRotate.jspx
@@ -0,0 +1,52 @@
+<!--
+ 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.
+-->
+<!--
+ - This example is based off the textRotate.svg example that comes
+ - with Apache Batik. The original example was written by Bill Haneman.
+ - This version by Mark Roth.
+ -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ width="450" height="500" viewBox="0 0 450 500"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions"
+ xmlns:jsp="http://java.sun.com/JSP/Page">
+ <jsp:directive.page contentType="image/svg+xml" />
+ <title>JSP 2.0 JSPX</title>
+ <!-- select name parameter, or default to JSPX -->
+ <c:set var="name" value='${empty fn:escapeXml(param["name"]) ? "JSPX" : fn:escapeXml(param["name"])}'/>
+ <g id="testContent">
+ <text class="title" x="50%" y="10%" font-size="15" text-anchor="middle" >
+ JSP 2.0 XML Syntax (.jspx) Demo</text>
+ <text class="title" x="50%" y="15%" font-size="15" text-anchor="middle" >
+ Try changing the name parameter!</text>
+ <g opacity="1.0" transform="translate(225, 250)" id="rotatedText">
+ <c:forEach var="i" begin="1" end="24">
+ <jsp:text>
+ <![CDATA[<g opacity="0.95" transform="scale(1.05) rotate(15)">]]>
+ </jsp:text>
+ <text x="0" y="0" transform="scale(1.6, 1.6)" fill="DarkSlateBlue"
+ text-anchor="middle" font-size="40" font-family="Serif"
+ id="words">${name}</text>
+ </c:forEach>
+ <c:forEach var="i" begin="1" end="24">
+ <jsp:text><![CDATA[</g>]]></jsp:text>
+ </c:forEach>
+ <text style="font-size:75;font-family:Serif;fill:white"
+ text-anchor="middle">${name}</text>
+ </g>
+ </g>
+</svg>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/jspx/textRotate.jspx.html b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/textRotate.jspx.html
new file mode 100644
index 0000000..5846a19
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/jspx/textRotate.jspx.html
@@ -0,0 +1,54 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<!--
+ - This example is based off the textRotate.svg example that comes
+ - with Apache Batik. The original example was written by Bill Haneman.
+ - This version by Mark Roth.
+ -->
+<svg xmlns="http://www.w3.org/2000/svg"
+ width="450" height="500" viewBox="0 0 450 500"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions"
+ xmlns:jsp="http://java.sun.com/JSP/Page">
+ <jsp:directive.page contentType="image/svg+xml" />
+ <title>JSP 2.0 JSPX</title>
+ <!-- select name parameter, or default to JSPX -->
+ <c:set var="name" value='${empty fn:escapeXml(param["name"]) ? "JSPX" : fn:escapeXml(param["name"])}'/>
+ <g id="testContent">
+ <text class="title" x="50%" y="10%" font-size="15" text-anchor="middle" >
+ JSP 2.0 XML Syntax (.jspx) Demo</text>
+ <text class="title" x="50%" y="15%" font-size="15" text-anchor="middle" >
+ Try changing the name parameter!</text>
+ <g opacity="1.0" transform="translate(225, 250)" id="rotatedText">
+ <c:forEach var="i" begin="1" end="24">
+ <jsp:text>
+ <![CDATA[<g opacity="0.95" transform="scale(1.05) rotate(15)">]]>
+ </jsp:text>
+ <text x="0" y="0" transform="scale(1.6, 1.6)" fill="DarkSlateBlue"
+ text-anchor="middle" font-size="40" font-family="Serif"
+ id="words">${name}</text>
+ </c:forEach>
+ <c:forEach var="i" begin="1" end="24">
+ <jsp:text><![CDATA[</g>]]></jsp:text>
+ </c:forEach>
+ <text style="font-size:75;font-family:Serif;fill:white"
+ text-anchor="middle">${name}</text>
+ </g>
+ </g>
+</svg>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/misc/EchoAttributesTag.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/misc/EchoAttributesTag.java.html
new file mode 100644
index 0000000..4e62250
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/misc/EchoAttributesTag.java.html
@@ -0,0 +1,56 @@
+<html><body><pre>
+/*
+* 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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.JspWriter;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import javax.servlet.jsp.tagext.DynamicAttributes;
+import java.util.ArrayList;
+import java.io.IOException;
+
+/**
+ * SimpleTag handler that echoes all its attributes
+ */
+public class EchoAttributesTag
+ extends SimpleTagSupport
+ implements DynamicAttributes
+{
+ private ArrayList keys = new ArrayList();
+ private ArrayList values = new ArrayList();
+
+ public void doTag() throws JspException, IOException {
+ JspWriter out = getJspContext().getOut();
+ for( int i = 0; i < keys.size(); i++ ) {
+ String key = (String)keys.get( i );
+ Object value = values.get( i );
+ out.println( "<li>" + key + " = " + value + "</li>" );
+ }
+ }
+
+ public void setDynamicAttribute( String uri, String localName,
+ Object value )
+ throws JspException
+ {
+ keys.add( localName );
+ values.add( value );
+ }
+}
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/misc/coda.jspf b/tomcat-uid/webapps/examples/jsp/jsp2/misc/coda.jspf
new file mode 100644
index 0000000..20de7f6
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/misc/coda.jspf
@@ -0,0 +1,21 @@
+<!--
+ 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.
+-->
+<hr>
+<center>
+This banner included with <include-coda>
+</center>
+<hr>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/misc/coda.jspf.html b/tomcat-uid/webapps/examples/jsp/jsp2/misc/coda.jspf.html
new file mode 100644
index 0000000..ef5a1b3
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/misc/coda.jspf.html
@@ -0,0 +1,23 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<hr>
+<center>
+This banner included with &lt;include-coda&gt;
+</center>
+<hr>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/misc/config.html b/tomcat-uid/webapps/examples/jsp/jsp2/misc/config.html
new file mode 100644
index 0000000..ebd2f4c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/misc/config.html
@@ -0,0 +1,35 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="config.jsp"><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><a href="config.jsp.html">Source Code for config.jsp<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="prelude.jspf.html">Source Code for prelude.jspf<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="coda.jspf.html">Source Code for coda.jspf<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/misc/config.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/misc/config.jsp
new file mode 100644
index 0000000..7ccf481
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/misc/config.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.
+-->
+<%@ taglib prefix="my" uri="http://tomcat.apache.org/jsp2-example-taglib"%>
+ <h1>JSP 2.0 Examples - JSP Configuration</h1>
+ <hr>
+ <p>Using a <jsp-property-group> element in the web.xml
+ deployment descriptor, this JSP page has been configured in the
+ following ways:</p>
+ <ul>
+ <li>Uses <include-prelude> to include the top banner.</li>
+ <li>Uses <include-coda> to include the bottom banner.</li>
+ <li>Uses <scripting-invalid> true to disable
+ <% scripting %> elements</li>
+ <li>Uses <el-ignored> true to disable ${EL} elements</li>
+ <li>Uses <page-encoding> ISO-8859-1 to set the page encoding (though this is the default anyway)</li>
+ </ul>
+ There are various other configuration options that can be used.
+
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/misc/config.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/misc/config.jsp.html
new file mode 100644
index 0000000..033f2d2
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/misc/config.jsp.html
@@ -0,0 +1,34 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="my" uri="http://tomcat.apache.org/jsp2-example-taglib"%>
+ <h1>JSP 2.0 Examples - JSP Configuration</h1>
+ <hr>
+ <p>Using a &lt;jsp-property-group&gt; element in the web.xml
+ deployment descriptor, this JSP page has been configured in the
+ following ways:</p>
+ <ul>
+ <li>Uses &lt;include-prelude&gt; to include the top banner.</li>
+ <li>Uses &lt;include-coda&gt; to include the bottom banner.</li>
+ <li>Uses &lt;scripting-invalid&gt; true to disable
+ &lt;% scripting %&gt; elements</li>
+ <li>Uses &lt;el-ignored&gt; true to disable ${EL} elements</li>
+ <li>Uses &lt;page-encoding&gt; ISO-8859-1 to set the page encoding (though this is the default anyway)</li>
+ </ul>
+ There are various other configuration options that can be used.
+
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/misc/dynamicattrs.html b/tomcat-uid/webapps/examples/jsp/jsp2/misc/dynamicattrs.html
new file mode 100644
index 0000000..a02a987
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/misc/dynamicattrs.html
@@ -0,0 +1,33 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="dynamicattrs.jsp"><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><a href="dynamicattrs.jsp.html">Source Code for dynamicattrs.jsp<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="EchoAttributesTag.java.html">Source Code for EchoAttributesTag.java<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp
new file mode 100644
index 0000000..637dea9
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp
@@ -0,0 +1,44 @@
+<!--
+ 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.
+-->
+<%@ taglib prefix="my" uri="http://tomcat.apache.org/jsp2-example-taglib"%>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Dynamic Attributes</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Dynamic Attributes</h1>
+ <hr>
+ <p>This JSP page invokes a custom tag that accepts a dynamic set
+ of attributes. The tag echoes the name and value of all attributes
+ passed to it.</p>
+ <hr>
+ <h2>Invocation 1 (six attributes)</h2>
+ <ul>
+ <my:echoAttributes x="1" y="2" z="3" r="red" g="green" b="blue"/>
+ </ul>
+ <h2>Invocation 2 (zero attributes)</h2>
+ <ul>
+ <my:echoAttributes/>
+ </ul>
+ <h2>Invocation 3 (three attributes)</h2>
+ <ul>
+ <my:echoAttributes dogName="Scruffy"
+ catName="Fluffy"
+ blowfishName="Puffy"/>
+ </ul>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp.html
new file mode 100644
index 0000000..ec47c8c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/misc/dynamicattrs.jsp.html
@@ -0,0 +1,46 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="my" uri="http://tomcat.apache.org/jsp2-example-taglib"%>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Dynamic Attributes</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Dynamic Attributes</h1>
+ <hr>
+ <p>This JSP page invokes a custom tag that accepts a dynamic set
+ of attributes. The tag echoes the name and value of all attributes
+ passed to it.</p>
+ <hr>
+ <h2>Invocation 1 (six attributes)</h2>
+ <ul>
+ <my:echoAttributes x="1" y="2" z="3" r="red" g="green" b="blue"/>
+ </ul>
+ <h2>Invocation 2 (zero attributes)</h2>
+ <ul>
+ <my:echoAttributes/>
+ </ul>
+ <h2>Invocation 3 (three attributes)</h2>
+ <ul>
+ <my:echoAttributes dogName="Scruffy"
+ catName="Fluffy"
+ blowfishName="Puffy"/>
+ </ul>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/misc/prelude.jspf b/tomcat-uid/webapps/examples/jsp/jsp2/misc/prelude.jspf
new file mode 100644
index 0000000..9772e1c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/misc/prelude.jspf
@@ -0,0 +1,21 @@
+<!--
+ 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.
+-->
+<hr>
+<center>
+This banner included with <include-prelude>
+</center>
+<hr>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/misc/prelude.jspf.html b/tomcat-uid/webapps/examples/jsp/jsp2/misc/prelude.jspf.html
new file mode 100644
index 0000000..f928f18
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/misc/prelude.jspf.html
@@ -0,0 +1,23 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<hr>
+<center>
+This banner included with &lt;include-prelude&gt;
+</center>
+<hr>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/BookBean.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/BookBean.java.html
new file mode 100644
index 0000000..a977a8c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/BookBean.java.html
@@ -0,0 +1,46 @@
+<html><body><pre>
+/*
+* 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.
+*/
+
+
+package jsp2.examples;
+
+public class BookBean {
+ private String title;
+ private String author;
+ private String isbn;
+
+ public BookBean( String title, String author, String isbn ) {
+ this.title = title;
+ this.author = author;
+ this.isbn = isbn;
+ }
+
+ public String getTitle() {
+ return this.title;
+ }
+
+ public String getAuthor() {
+ return this.author;
+ }
+
+ public String getIsbn() {
+ return this.isbn;
+ }
+
+}
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/FindBookSimpleTag.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/FindBookSimpleTag.java.html
new file mode 100644
index 0000000..d010f0a
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/FindBookSimpleTag.java.html
@@ -0,0 +1,46 @@
+<html><body><pre>
+/*
+* 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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import jsp2.examples.BookBean;
+
+/**
+ * SimpleTag handler that pretends to search for a book, and stores
+ * the result in a scoped variable.
+ */
+public class FindBookSimpleTag extends SimpleTagSupport {
+ private String var;
+
+ private static final String BOOK_TITLE = "The Lord of the Rings";
+ private static final String BOOK_AUTHOR = "J. R. R. Tolkein";
+ private static final String BOOK_ISBN = "0618002251";
+
+ public void doTag() throws JspException {
+ BookBean book = new BookBean( BOOK_TITLE, BOOK_AUTHOR, BOOK_ISBN );
+ getJspContext().setAttribute( this.var, book );
+ }
+
+ public void setVar( String var ) {
+ this.var = var;
+ }
+}
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/Functions.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/Functions.java.html
new file mode 100644
index 0000000..350fce6
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/Functions.java.html
@@ -0,0 +1,45 @@
+<html><body><pre>
+/*
+* 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.
+*/
+package jsp2.examples.el;
+
+/**
+ * Defines the functions for the jsp2 example tag library.
+ *
+ * <p>Each function is defined as a static method.</p>
+ */
+public class Functions {
+ public static String reverse( String text ) {
+ return new StringBuffer( text ).reverse().toString();
+ }
+
+ public static int numVowels( String text ) {
+ String vowels = "aeiouAEIOU";
+ int result = 0;
+ for( int i = 0; i < text.length(); i++ ) {
+ if( vowels.indexOf( text.charAt( i ) ) != -1 ) {
+ result++;
+ }
+ }
+ return result;
+ }
+
+ public static String caps( String text ) {
+ return text.toUpperCase();
+ }
+}
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/HelloWorldSimpleTag.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/HelloWorldSimpleTag.java.html
new file mode 100644
index 0000000..c409839
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/HelloWorldSimpleTag.java.html
@@ -0,0 +1,34 @@
+<html><body><pre>
+/*
+* 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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import java.io.IOException;
+
+/**
+ * SimpleTag handler that prints "Hello, world!"
+ */
+public class HelloWorldSimpleTag extends SimpleTagSupport {
+ public void doTag() throws JspException, IOException {
+ getJspContext().getOut().write( "Hello, world!" );
+ }
+}
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/RepeatSimpleTag.java.html b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/RepeatSimpleTag.java.html
new file mode 100644
index 0000000..2ad96eb
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/RepeatSimpleTag.java.html
@@ -0,0 +1,44 @@
+<html><body><pre>
+/*
+* 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.
+*/
+
+
+package jsp2.examples.simpletag;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+import java.io.IOException;
+
+/**
+ * SimpleTag handler that accepts a num attribute and
+ * invokes its body 'num' times.
+ */
+public class RepeatSimpleTag extends SimpleTagSupport {
+ private int num;
+
+ public void doTag() throws JspException, IOException {
+ for (int i=0; i<num; i++) {
+ getJspContext().setAttribute("count", String.valueOf( i + 1 ) );
+ getJspBody().invoke(null);
+ }
+ }
+
+ public void setNum(int num) {
+ this.num = num;
+ }
+}
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/book.html b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/book.html
new file mode 100644
index 0000000..62cf284
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/book.html
@@ -0,0 +1,37 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="book.jsp"><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><a href="book.jsp.html">Source Code for the Book Example JSP<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="FindBookSimpleTag.java.html">Source Code for the FindBook SimpleTag Handler<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="BookBean.java.html">Source Code for BookBean<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="Functions.java.html">Source Code for the EL Functions<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/book.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/book.jsp
new file mode 100644
index 0000000..7a9a064
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/book.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.
+-->
+<%@ taglib prefix="my" uri="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Book SimpleTag Handler</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Book SimpleTag Handler</h1>
+ <hr>
+ <p>Illustrates a semi-realistic use of SimpleTag and the Expression
+ Language. First, a <my:findBook> tag is invoked to populate
+ the page context with a BookBean. Then, the books fields are printed
+ in all caps.</p>
+ <br>
+ <b><u>Result:</u></b><br>
+ <my:findBook var="book"/>
+ <table border="1">
+ <thead>
+ <td><b>Field</b></td>
+ <td><b>Value</b></td>
+ <td><b>Capitalized</b></td>
+ </thead>
+ <tr>
+ <td>Title</td>
+ <td>${book.title}</td>
+ <td>${my:caps(book.title)}</td>
+ </tr>
+ <tr>
+ <td>Author</td>
+ <td>${book.author}</td>
+ <td>${my:caps(book.author)}</td>
+ </tr>
+ <tr>
+ <td>ISBN</td>
+ <td>${book.isbn}</td>
+ <td>${my:caps(book.isbn)}</td>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/book.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/book.jsp.html
new file mode 100644
index 0000000..7ecfe3b
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/book.jsp.html
@@ -0,0 +1,57 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="my" uri="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Book SimpleTag Handler</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Book SimpleTag Handler</h1>
+ <hr>
+ <p>Illustrates a semi-realistic use of SimpleTag and the Expression
+ Language. First, a &lt;my:findBook&gt; tag is invoked to populate
+ the page context with a BookBean. Then, the books fields are printed
+ in all caps.</p>
+ <br>
+ <b><u>Result:</u></b><br>
+ <my:findBook var="book"/>
+ <table border="1">
+ <thead>
+ <td><b>Field</b></td>
+ <td><b>Value</b></td>
+ <td><b>Capitalized</b></td>
+ </thead>
+ <tr>
+ <td>Title</td>
+ <td>${book.title}</td>
+ <td>${my:caps(book.title)}</td>
+ </tr>
+ <tr>
+ <td>Author</td>
+ <td>${book.author}</td>
+ <td>${my:caps(book.author)}</td>
+ </tr>
+ <tr>
+ <td>ISBN</td>
+ <td>${book.isbn}</td>
+ <td>${my:caps(book.isbn)}</td>
+ </tr>
+ </table>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/hello.html b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/hello.html
new file mode 100644
index 0000000..1e7dfcb
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/hello.html
@@ -0,0 +1,33 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="hello.jsp"><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><a href="hello.jsp.html">Source Code for the Hello World Tag Example JSP<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="HelloWorldSimpleTag.java.html">Source Code for the Hello World SimpleTag Handler<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/hello.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/hello.jsp
new file mode 100644
index 0000000..4222b2e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/hello.jsp
@@ -0,0 +1,31 @@
+<!--
+ 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.
+-->
+<%@ taglib prefix="mytag" uri="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Hello World SimpleTag Handler</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Hello World SimpleTag Handler</h1>
+ <hr>
+ <p>This tag handler simply echos "Hello, World!" It's an example of
+ a very basic SimpleTag handler with no body.</p>
+ <br>
+ <b><u>Result:</u></b>
+ <mytag:helloWorld/>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/hello.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/hello.jsp.html
new file mode 100644
index 0000000..c363802
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/hello.jsp.html
@@ -0,0 +1,33 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="mytag" uri="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Hello World SimpleTag Handler</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Hello World SimpleTag Handler</h1>
+ <hr>
+ <p>This tag handler simply echos "Hello, World!" It's an example of
+ a very basic SimpleTag handler with no body.</p>
+ <br>
+ <b><u>Result:</u></b>
+ <mytag:helloWorld/>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/repeat.html b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/repeat.html
new file mode 100644
index 0000000..18ff5ed
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/repeat.html
@@ -0,0 +1,33 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="repeat.jsp"><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><a href="repeat.jsp.html">Source Code for the Repeat Tag Example JSP<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="RepeatSimpleTag.java.html">Source Code for the Repeat SimpleTag Handler<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/repeat.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/repeat.jsp
new file mode 100644
index 0000000..1f3d008
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/repeat.jsp
@@ -0,0 +1,39 @@
+<!--
+ 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.
+-->
+<%@ taglib prefix="mytag" uri="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Repeat SimpleTag Handler</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Repeat SimpleTag Handler</h1>
+ <hr>
+ <p>This tag handler accepts a "num" parameter and repeats the body of the
+ tag "num" times. It's a simple example, but the implementation of
+ such a tag in JSP 2.0 is substantially simpler than the equivalent
+ JSP 1.2-style classic tag handler.</p>
+ <p>The body of the tag is encapsulated in a "JSP Fragment" and passed
+ to the tag handler, which then executes it five times, inside a
+ for loop. The tag handler passes in the current invocation in a
+ scoped variable called count, which can be accessed using the EL.</p>
+ <br>
+ <b><u>Result:</u></b><br>
+ <mytag:repeat num="5">
+ Invocation ${count} of 5<br>
+ </mytag:repeat>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/repeat.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/repeat.jsp.html
new file mode 100644
index 0000000..e36b66c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/simpletag/repeat.jsp.html
@@ -0,0 +1,41 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="mytag" uri="/WEB-INF/jsp2/jsp2-example-taglib.tld" %>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Repeat SimpleTag Handler</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Repeat SimpleTag Handler</h1>
+ <hr>
+ <p>This tag handler accepts a "num" parameter and repeats the body of the
+ tag "num" times. It's a simple example, but the implementation of
+ such a tag in JSP 2.0 is substantially simpler than the equivalent
+ JSP 1.2-style classic tag handler.</p>
+ <p>The body of the tag is encapsulated in a "JSP Fragment" and passed
+ to the tag handler, which then executes it five times, inside a
+ for loop. The tag handler passes in the current invocation in a
+ scoped variable called count, which can be accessed using the EL.</p>
+ <br>
+ <b><u>Result:</u></b><br>
+ <mytag:repeat num="5">
+ Invocation ${count} of 5<br>
+ </mytag:repeat>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/displayProducts.tag.html b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/displayProducts.tag.html
new file mode 100644
index 0000000..6388336
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/displayProducts.tag.html
@@ -0,0 +1,57 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ attribute name="normalPrice" fragment="true" %>
+<%@ attribute name="onSale" fragment="true" %>
+<%@ variable name-given="name" %>
+<%@ variable name-given="price" %>
+<%@ variable name-given="origPrice" %>
+<%@ variable name-given="salePrice" %>
+
+<table border="1">
+ <tr>
+ <td>
+ <c:set var="name" value="Hand-held Color PDA"/>
+ <c:set var="price" value="$298.86"/>
+ <jsp:invoke fragment="normalPrice"/>
+ </td>
+ <td>
+ <c:set var="name" value="4-Pack 150 Watt Light Bulbs"/>
+ <c:set var="origPrice" value="$2.98"/>
+ <c:set var="salePrice" value="$2.32"/>
+ <jsp:invoke fragment="onSale"/>
+ </td>
+ <td>
+ <c:set var="name" value="Digital Cellular Phone"/>
+ <c:set var="price" value="$68.74"/>
+ <jsp:invoke fragment="normalPrice"/>
+ </td>
+ <td>
+ <c:set var="name" value="Baby Grand Piano"/>
+ <c:set var="price" value="$10,800.00"/>
+ <jsp:invoke fragment="normalPrice"/>
+ </td>
+ <td>
+ <c:set var="name" value="Luxury Car w/ Leather Seats"/>
+ <c:set var="origPrice" value="$23,980.00"/>
+ <c:set var="salePrice" value="$21,070.00"/>
+ <jsp:invoke fragment="onSale"/>
+ </td>
+ </tr>
+</table>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/hello.html b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/hello.html
new file mode 100644
index 0000000..aab12a7
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/hello.html
@@ -0,0 +1,33 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="hello.jsp"><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><a href="hello.jsp.html">Source Code for hello.jsp<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="helloWorld.tag.html">Source Code for helloWorld.tag<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/hello.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/hello.jsp
new file mode 100644
index 0000000..e93c7c5
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/hello.jsp
@@ -0,0 +1,35 @@
+<!--
+ 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.
+-->
+<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Hello World Using a Tag File</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Hello World Using a Tag File</h1>
+ <hr>
+ <p>This JSP page invokes a custom tag that simply echos "Hello, World!"
+ The custom tag is generated from a tag file in the /WEB-INF/tags
+ directory.</p>
+ <p>Notice that we did not need to write a TLD for this tag. We just
+ created /WEB-INF/tags/helloWorld.tag, imported it using the taglib
+ directive, and used it!</p>
+ <br>
+ <b><u>Result:</u></b>
+ <tags:helloWorld/>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/hello.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/hello.jsp.html
new file mode 100644
index 0000000..c3b7b4f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/hello.jsp.html
@@ -0,0 +1,37 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Hello World Using a Tag File</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Hello World Using a Tag File</h1>
+ <hr>
+ <p>This JSP page invokes a custom tag that simply echos "Hello, World!"
+ The custom tag is generated from a tag file in the /WEB-INF/tags
+ directory.</p>
+ <p>Notice that we did not need to write a TLD for this tag. We just
+ created /WEB-INF/tags/helloWorld.tag, imported it using the taglib
+ directive, and used it!</p>
+ <br>
+ <b><u>Result:</u></b>
+ <tags:helloWorld/>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/helloWorld.tag.html b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/helloWorld.tag.html
new file mode 100644
index 0000000..e335986
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/helloWorld.tag.html
@@ -0,0 +1,19 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+Hello, world!
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/panel.html b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/panel.html
new file mode 100644
index 0000000..161b70d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/panel.html
@@ -0,0 +1,33 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="panel.jsp"><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><a href="panel.jsp.html">Source Code for panel.jsp<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="panel.tag.html">Source Code for panel.tag<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/panel.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/panel.jsp
new file mode 100644
index 0000000..4dfc483
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/panel.jsp
@@ -0,0 +1,58 @@
+<!--
+ 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.
+-->
+<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Panels using Tag Files</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Panels using Tag Files</h1>
+ <hr>
+ <p>This JSP page invokes a custom tag that draws a
+ panel around the contents of the tag body. Normally, such a tag
+ implementation would require a Java class with many println() statements,
+ outputting HTML. Instead, we can use a .tag file as a template,
+ and we don't need to write a single line of Java or even a TLD!</p>
+ <hr>
+ <table border="0">
+ <tr valign="top">
+ <td>
+ <tags:panel color="#ff8080" bgcolor="#ffc0c0" title="Panel 1">
+ First panel.<br/>
+ </tags:panel>
+ </td>
+ <td>
+ <tags:panel color="#80ff80" bgcolor="#c0ffc0" title="Panel 2">
+ Second panel.<br/>
+ Second panel.<br/>
+ Second panel.<br/>
+ Second panel.<br/>
+ </tags:panel>
+ </td>
+ <td>
+ <tags:panel color="#8080ff" bgcolor="#c0c0ff" title="Panel 3">
+ Third panel.<br/>
+ <tags:panel color="#ff80ff" bgcolor="#ffc0ff" title="Inner">
+ A panel in a panel.
+ </tags:panel>
+ Third panel.<br/>
+ </tags:panel>
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/panel.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/panel.jsp.html
new file mode 100644
index 0000000..0cc746d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/panel.jsp.html
@@ -0,0 +1,60 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Panels using Tag Files</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Panels using Tag Files</h1>
+ <hr>
+ <p>This JSP page invokes a custom tag that draws a
+ panel around the contents of the tag body. Normally, such a tag
+ implementation would require a Java class with many println() statements,
+ outputting HTML. Instead, we can use a .tag file as a template,
+ and we don't need to write a single line of Java or even a TLD!</p>
+ <hr>
+ <table border="0">
+ <tr valign="top">
+ <td>
+ <tags:panel color="#ff8080" bgcolor="#ffc0c0" title="Panel 1">
+ First panel.<br/>
+ </tags:panel>
+ </td>
+ <td>
+ <tags:panel color="#80ff80" bgcolor="#c0ffc0" title="Panel 2">
+ Second panel.<br/>
+ Second panel.<br/>
+ Second panel.<br/>
+ Second panel.<br/>
+ </tags:panel>
+ </td>
+ <td>
+ <tags:panel color="#8080ff" bgcolor="#c0c0ff" title="Panel 3">
+ Third panel.<br/>
+ <tags:panel color="#ff80ff" bgcolor="#ffc0ff" title="Inner">
+ A panel in a panel.
+ </tags:panel>
+ Third panel.<br/>
+ </tags:panel>
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/panel.tag.html b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/panel.tag.html
new file mode 100644
index 0000000..df1c214
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/panel.tag.html
@@ -0,0 +1,31 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ attribute name="color" %>
+<%@ attribute name="bgcolor" %>
+<%@ attribute name="title" %>
+<table border="1" bgcolor="${color}">
+ <tr>
+ <td><b>${title}</b></td>
+ </tr>
+ <tr>
+ <td bgcolor="${bgcolor}">
+ <jsp:doBody/>
+ </td>
+ </tr>
+</table>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/products.html b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/products.html
new file mode 100644
index 0000000..e4780b9
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/products.html
@@ -0,0 +1,33 @@
+<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>View Source Code</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="products.jsp"><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><a href="products.jsp.html">Source Code for products.jsp<font color="#0000FF"></a>
+ </font> </h3>
+<h3><a href="displayProducts.tag.html">Source Code for displayProducts.tag<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/products.jsp b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/products.jsp
new file mode 100644
index 0000000..328cc96
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/products.jsp
@@ -0,0 +1,54 @@
+<!--
+ 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.
+-->
+<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Display Products Tag File</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Display Products Tag File</h1>
+ <hr>
+ <p>This JSP page invokes a tag file that displays a listing of
+ products. The custom tag accepts two fragments that enable
+ customization of appearance. One for when the product is on sale
+ and one for normal price.</p>
+ <p>The tag is invoked twice, using different styles</p>
+ <hr>
+ <h2>Products</h2>
+ <tags:displayProducts>
+ <jsp:attribute name="normalPrice">
+ Item: ${name}<br/>
+ Price: ${price}
+ </jsp:attribute>
+ <jsp:attribute name="onSale">
+ Item: ${name}<br/>
+ <font color="red"><strike>Was: ${origPrice}</strike></font><br/>
+ <b>Now: ${salePrice}</b>
+ </jsp:attribute>
+ </tags:displayProducts>
+ <hr>
+ <h2>Products (Same tag, alternate style)</h2>
+ <tags:displayProducts>
+ <jsp:attribute name="normalPrice">
+ <b>${name}</b> @ ${price} ea.
+ </jsp:attribute>
+ <jsp:attribute name="onSale">
+ <b>${name}</b> @ ${salePrice} ea. (was: ${origPrice})
+ </jsp:attribute>
+ </tags:displayProducts>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/products.jsp.html b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/products.jsp.html
new file mode 100644
index 0000000..f9b6e6f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/products.jsp.html
@@ -0,0 +1,56 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
+<html>
+ <head>
+ <title>JSP 2.0 Examples - Display Products Tag File</title>
+ </head>
+ <body>
+ <h1>JSP 2.0 Examples - Display Products Tag File</h1>
+ <hr>
+ <p>This JSP page invokes a tag file that displays a listing of
+ products. The custom tag accepts two fragments that enable
+ customization of appearance. One for when the product is on sale
+ and one for normal price.</p>
+ <p>The tag is invoked twice, using different styles</p>
+ <hr>
+ <h2>Products</h2>
+ <tags:displayProducts>
+ <jsp:attribute name="normalPrice">
+ Item: ${name}<br/>
+ Price: ${price}
+ </jsp:attribute>
+ <jsp:attribute name="onSale">
+ Item: ${name}<br/>
+ <font color="red"><strike>Was: ${origPrice}</strike></font><br/>
+ <b>Now: ${salePrice}</b>
+ </jsp:attribute>
+ </tags:displayProducts>
+ <hr>
+ <h2>Products (Same tag, alternate style)</h2>
+ <tags:displayProducts>
+ <jsp:attribute name="normalPrice">
+ <b>${name}</b> @ ${price} ea.
+ </jsp:attribute>
+ <jsp:attribute name="onSale">
+ <b>${name}</b> @ ${salePrice} ea. (was: ${origPrice})
+ </jsp:attribute>
+ </tags:displayProducts>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/xhtmlbasic.tag.html b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/xhtmlbasic.tag.html
new file mode 100644
index 0000000..a8bd497
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsp2/tagfiles/xhtmlbasic.tag.html
@@ -0,0 +1,23 @@
+<html><body><pre>
+<!--
+ 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 XHTML Basic 1.0//EN"
+"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<jsp:doBody/>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsptoserv/hello.jsp b/tomcat-uid/webapps/examples/jsp/jsptoserv/hello.jsp
new file mode 100644
index 0000000..5f332ec
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsptoserv/hello.jsp
@@ -0,0 +1,26 @@
+<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.
+-->
+<body bgcolor="white">
+
+<h1>
+I have been invoked by
+<% out.print (request.getAttribute("servletName").toString()); %>
+Servlet.
+</h1>
+
+</html>
\ No newline at end of file
diff --git a/tomcat-uid/webapps/examples/jsp/jsptoserv/hello.jsp.html b/tomcat-uid/webapps/examples/jsp/jsptoserv/hello.jsp.html
new file mode 100644
index 0000000..44ac35e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsptoserv/hello.jsp.html
@@ -0,0 +1,28 @@
+<html><body><pre>
+<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.
+-->
+<body bgcolor="white">
+
+<h1>
+I have been invoked by
+<% out.print (request.getAttribute("servletName").toString()); %>
+Servlet.
+</h1>
+
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp b/tomcat-uid/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp
new file mode 100644
index 0000000..c08192f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp
@@ -0,0 +1,23 @@
+<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.
+-->
+<body bgcolor="white">
+
+<!-- Forward to a servlet -->
+<jsp:forward page="/servletToJsp" />
+
+</html>
\ No newline at end of file
diff --git a/tomcat-uid/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp.html b/tomcat-uid/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp.html
new file mode 100644
index 0000000..d694ab4
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsptoserv/jsptoservlet.jsp.html
@@ -0,0 +1,25 @@
+<html><body><pre>
+<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.
+-->
+<body bgcolor="white">
+
+<!-- Forward to a servlet -->
+<jsp:forward page="/servletToJsp" />
+
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsptoserv/jts.html b/tomcat-uid/webapps/examples/jsp/jsptoserv/jts.html
new file mode 100644
index 0000000..ec7d5ad
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsptoserv/jts.html
@@ -0,0 +1,34 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="jsptoservlet.jsp"><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><a href="jsptoservlet.jsp.html">Source Code for JSP calling servlet <font color="#0000FF"></a>
+ </font> </h3>
+
+<h3><a href="servletToJsp.java.html">Source Code for Servlet calling JSP
+<font color="#0000FF"></a> </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/jsptoserv/servletToJsp.java.html b/tomcat-uid/webapps/examples/jsp/jsptoserv/servletToJsp.java.html
new file mode 100644
index 0000000..bf6f249
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/jsptoserv/servletToJsp.java.html
@@ -0,0 +1,34 @@
+<html><body><pre>
+/*
+* 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.
+*/
+import javax.servlet.http.*;
+
+public class servletToJsp extends HttpServlet {
+
+ public void doGet (HttpServletRequest request,
+ HttpServletResponse response) {
+
+ try {
+ // Set the attribute and Forward to hello.jsp
+ request.setAttribute ("servletName", "servletToJsp");
+ getServletConfig().getServletContext().getRequestDispatcher("/jsp/jsptoserv/hello.jsp").forward(request, response);
+ } catch (Exception ex) {
+ ex.printStackTrace ();
+ }
+ }
+}
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/num/numguess.html b/tomcat-uid/webapps/examples/jsp/num/numguess.html
new file mode 100644
index 0000000..431fda0
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/num/numguess.html
@@ -0,0 +1,34 @@
+<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.
+
+ Number Guess Game
+ Written by Jason Hunter, CTO, K&A Software
+ http://www.servlets.com
+-->
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="numguess.jsp"><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><a href="numguess.jsp.html">Source Code for Numguess Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/num/numguess.jsp b/tomcat-uid/webapps/examples/jsp/num/numguess.jsp
new file mode 100644
index 0000000..cfcf6fb
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/num/numguess.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.
+
+ Number Guess Game
+ Written by Jason Hunter, CTO, K&A Software
+ http://www.servlets.com
+-->
+
+<%@ page import = "num.NumberGuessBean" %>
+
+<jsp:useBean id="numguess" class="num.NumberGuessBean" scope="session"/>
+<jsp:setProperty name="numguess" property="*"/>
+
+<html>
+<head><title>Number Guess</title></head>
+<body bgcolor="white">
+<font size=4>
+
+<% if (numguess.getSuccess()) { %>
+
+ Congratulations! You got it.
+ And after just <%= numguess.getNumGuesses() %> tries.<p>
+
+ <% numguess.reset(); %>
+
+ Care to <a href="numguess.jsp">try again</a>?
+
+<% } else if (numguess.getNumGuesses() == 0) { %>
+
+ Welcome to the Number Guess game.<p>
+
+ I'm thinking of a number between 1 and 100.<p>
+
+ <form method=get>
+ What's your guess? <input type=text name=guess>
+ <input type=submit value="Submit">
+ </form>
+
+<% } else { %>
+
+ Good guess, but nope. Try <b><%= numguess.getHint() %></b>.
+
+ You have made <%= numguess.getNumGuesses() %> guesses.<p>
+
+ I'm thinking of a number between 1 and 100.<p>
+
+ <form method=get>
+ What's your guess? <input type=text name=guess>
+ <input type=submit value="Submit">
+ </form>
+
+<% } %>
+
+</font>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/num/numguess.jsp.html b/tomcat-uid/webapps/examples/jsp/num/numguess.jsp.html
new file mode 100644
index 0000000..01fef5d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/num/numguess.jsp.html
@@ -0,0 +1,71 @@
+<html><body><pre>
+<!--
+ 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.
+
+ Number Guess Game
+ Written by Jason Hunter, CTO, K&A Software
+ http://www.servlets.com
+-->
+
+<%@ page import = "num.NumberGuessBean" %>
+
+<jsp:useBean id="numguess" class="num.NumberGuessBean" scope="session"/>
+<jsp:setProperty name="numguess" property="*"/>
+
+<html>
+<head><title>Number Guess</title></head>
+<body bgcolor="white">
+<font size=4>
+
+<% if (numguess.getSuccess()) { %>
+
+ Congratulations! You got it.
+ And after just <%= numguess.getNumGuesses() %> tries.<p>
+
+ <% numguess.reset(); %>
+
+ Care to <a href="numguess.jsp">try again</a>?
+
+<% } else if (numguess.getNumGuesses() == 0) { %>
+
+ Welcome to the Number Guess game.<p>
+
+ I'm thinking of a number between 1 and 100.<p>
+
+ <form method=get>
+ What's your guess? <input type=text name=guess>
+ <input type=submit value="Submit">
+ </form>
+
+<% } else { %>
+
+ Good guess, but nope. Try <b><%= numguess.getHint() %></b>.
+
+ You have made <%= numguess.getNumGuesses() %> guesses.<p>
+
+ I'm thinking of a number between 1 and 100.<p>
+
+ <form method=get>
+ What's your guess? <input type=text name=guess>
+ <input type=submit value="Submit">
+ </form>
+
+<% } %>
+
+</font>
+</body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/plugin/applet/Clock2.class b/tomcat-uid/webapps/examples/jsp/plugin/applet/Clock2.class
new file mode 100644
index 0000000..32fa663
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/plugin/applet/Clock2.class
Binary files differ
diff --git a/tomcat-uid/webapps/examples/jsp/plugin/applet/Clock2.java b/tomcat-uid/webapps/examples/jsp/plugin/applet/Clock2.java
new file mode 100644
index 0000000..f228b82
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/plugin/applet/Clock2.java
@@ -0,0 +1,213 @@
+/*
+* 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.
+*/
+
+import java.util.*;
+import java.awt.*;
+import java.applet.*;
+import java.text.*;
+
+/**
+ * Time!
+ *
+ * @author Rachel Gollub
+ */
+
+public class Clock2 extends Applet implements Runnable {
+ Thread timer; // The thread that displays clock
+ int lastxs, lastys, lastxm,
+ lastym, lastxh, lastyh; // Dimensions used to draw hands
+ SimpleDateFormat formatter; // Formats the date displayed
+ String lastdate; // String to hold date displayed
+ Font clockFaceFont; // Font for number display on clock
+ Date currentDate; // Used to get date to display
+ Color handColor; // Color of main hands and dial
+ Color numberColor; // Color of second hand and numbers
+
+ public void init() {
+ int x,y;
+ lastxs = lastys = lastxm = lastym = lastxh = lastyh = 0;
+ formatter = new SimpleDateFormat ("EEE MMM dd hh:mm:ss yyyy", Locale.getDefault());
+ currentDate = new Date();
+ lastdate = formatter.format(currentDate);
+ clockFaceFont = new Font("Serif", Font.PLAIN, 14);
+ handColor = Color.blue;
+ numberColor = Color.darkGray;
+
+ try {
+ setBackground(new Color(Integer.parseInt(getParameter("bgcolor"),16)));
+ } catch (Exception E) { }
+ try {
+ handColor = new Color(Integer.parseInt(getParameter("fgcolor1"),16));
+ } catch (Exception E) { }
+ try {
+ numberColor = new Color(Integer.parseInt(getParameter("fgcolor2"),16));
+ } catch (Exception E) { }
+ resize(300,300); // Set clock window size
+ }
+
+ // Plotpoints allows calculation to only cover 45 degrees of the circle,
+ // and then mirror
+ public void plotpoints(int x0, int y0, int x, int y, Graphics g) {
+ g.drawLine(x0+x,y0+y,x0+x,y0+y);
+ g.drawLine(x0+y,y0+x,x0+y,y0+x);
+ g.drawLine(x0+y,y0-x,x0+y,y0-x);
+ g.drawLine(x0+x,y0-y,x0+x,y0-y);
+ g.drawLine(x0-x,y0-y,x0-x,y0-y);
+ g.drawLine(x0-y,y0-x,x0-y,y0-x);
+ g.drawLine(x0-y,y0+x,x0-y,y0+x);
+ g.drawLine(x0-x,y0+y,x0-x,y0+y);
+ }
+
+ // Circle is just Bresenham's algorithm for a scan converted circle
+ public void circle(int x0, int y0, int r, Graphics g) {
+ int x,y;
+ float d;
+ x=0;
+ y=r;
+ d=5/4-r;
+ plotpoints(x0,y0,x,y,g);
+
+ while (y>x){
+ if (d<0) {
+ d=d+2*x+3;
+ x++;
+ }
+ else {
+ d=d+2*(x-y)+5;
+ x++;
+ y--;
+ }
+ plotpoints(x0,y0,x,y,g);
+ }
+ }
+
+ // Paint is the main part of the program
+ public void paint(Graphics g) {
+ int xh, yh, xm, ym, xs, ys, s = 0, m = 10, h = 10, xcenter, ycenter;
+ String today;
+
+ currentDate = new Date();
+ SimpleDateFormat formatter = new SimpleDateFormat("s",Locale.getDefault());
+ try {
+ s = Integer.parseInt(formatter.format(currentDate));
+ } catch (NumberFormatException n) {
+ s = 0;
+ }
+ formatter.applyPattern("m");
+ try {
+ m = Integer.parseInt(formatter.format(currentDate));
+ } catch (NumberFormatException n) {
+ m = 10;
+ }
+ formatter.applyPattern("h");
+ try {
+ h = Integer.parseInt(formatter.format(currentDate));
+ } catch (NumberFormatException n) {
+ h = 10;
+ }
+ formatter.applyPattern("EEE MMM dd HH:mm:ss yyyy");
+ today = formatter.format(currentDate);
+ xcenter=80;
+ ycenter=55;
+
+ // a= s* pi/2 - pi/2 (to switch 0,0 from 3:00 to 12:00)
+ // x = r(cos a) + xcenter, y = r(sin a) + ycenter
+
+ xs = (int)(Math.cos(s * 3.14f/30 - 3.14f/2) * 45 + xcenter);
+ ys = (int)(Math.sin(s * 3.14f/30 - 3.14f/2) * 45 + ycenter);
+ xm = (int)(Math.cos(m * 3.14f/30 - 3.14f/2) * 40 + xcenter);
+ ym = (int)(Math.sin(m * 3.14f/30 - 3.14f/2) * 40 + ycenter);
+ xh = (int)(Math.cos((h*30 + m/2) * 3.14f/180 - 3.14f/2) * 30 + xcenter);
+ yh = (int)(Math.sin((h*30 + m/2) * 3.14f/180 - 3.14f/2) * 30 + ycenter);
+
+ // Draw the circle and numbers
+
+ g.setFont(clockFaceFont);
+ g.setColor(handColor);
+ circle(xcenter,ycenter,50,g);
+ g.setColor(numberColor);
+ g.drawString("9",xcenter-45,ycenter+3);
+ g.drawString("3",xcenter+40,ycenter+3);
+ g.drawString("12",xcenter-5,ycenter-37);
+ g.drawString("6",xcenter-3,ycenter+45);
+
+ // Erase if necessary, and redraw
+
+ g.setColor(getBackground());
+ if (xs != lastxs || ys != lastys) {
+ g.drawLine(xcenter, ycenter, lastxs, lastys);
+ g.drawString(lastdate, 5, 125);
+ }
+ if (xm != lastxm || ym != lastym) {
+ g.drawLine(xcenter, ycenter-1, lastxm, lastym);
+ g.drawLine(xcenter-1, ycenter, lastxm, lastym); }
+ if (xh != lastxh || yh != lastyh) {
+ g.drawLine(xcenter, ycenter-1, lastxh, lastyh);
+ g.drawLine(xcenter-1, ycenter, lastxh, lastyh); }
+ g.setColor(numberColor);
+ g.drawString("", 5, 125);
+ g.drawString(today, 5, 125);
+ g.drawLine(xcenter, ycenter, xs, ys);
+ g.setColor(handColor);
+ g.drawLine(xcenter, ycenter-1, xm, ym);
+ g.drawLine(xcenter-1, ycenter, xm, ym);
+ g.drawLine(xcenter, ycenter-1, xh, yh);
+ g.drawLine(xcenter-1, ycenter, xh, yh);
+ lastxs=xs; lastys=ys;
+ lastxm=xm; lastym=ym;
+ lastxh=xh; lastyh=yh;
+ lastdate = today;
+ currentDate=null;
+ }
+
+ public void start() {
+ timer = new Thread(this);
+ timer.start();
+ }
+
+ public void stop() {
+ timer = null;
+ }
+
+ public void run() {
+ Thread me = Thread.currentThread();
+ while (timer == me) {
+ try {
+ Thread.currentThread().sleep(100);
+ } catch (InterruptedException e) {
+ }
+ repaint();
+ }
+ }
+
+ public void update(Graphics g) {
+ paint(g);
+ }
+
+ public String getAppletInfo() {
+ return "Title: A Clock \nAuthor: Rachel Gollub, 1995 \nAn analog clock.";
+ }
+
+ public String[][] getParameterInfo() {
+ String[][] info = {
+ {"bgcolor", "hexadecimal RGB number", "The background color. Default is the color of your browser."},
+ {"fgcolor1", "hexadecimal RGB number", "The color of the hands and dial. Default is blue."},
+ {"fgcolor2", "hexadecimal RGB number", "The color of the seconds hand and numbers. Default is dark gray."}
+ };
+ return info;
+ }
+}
diff --git a/tomcat-uid/webapps/examples/jsp/plugin/plugin.html b/tomcat-uid/webapps/examples/jsp/plugin/plugin.html
new file mode 100644
index 0000000..036ce72
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/plugin/plugin.html
@@ -0,0 +1,30 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="plugin.jsp"><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><a href="plugin.jsp.html">Source Code for Plugin Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/plugin/plugin.jsp b/tomcat-uid/webapps/examples/jsp/plugin/plugin.jsp
new file mode 100644
index 0000000..12db7d4
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/plugin/plugin.jsp
@@ -0,0 +1,34 @@
+<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.
+-->
+<title> Plugin example </title>
+<body bgcolor="white">
+<h3> Current time is : </h3>
+<jsp:plugin type="applet" code="Clock2.class" codebase="applet" jreversion="1.2" width="160" height="150" >
+ <jsp:fallback>
+ Plugin tag OBJECT or EMBED not supported by browser.
+ </jsp:fallback>
+</jsp:plugin>
+<p>
+<h4>
+<font color=red>
+The above applet is loaded using the Java Plugin from a jsp page using the
+plugin tag.
+</font>
+</h4>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/plugin/plugin.jsp.html b/tomcat-uid/webapps/examples/jsp/plugin/plugin.jsp.html
new file mode 100644
index 0000000..b350d5e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/plugin/plugin.jsp.html
@@ -0,0 +1,36 @@
+<html><body><pre>
+<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.
+-->
+<title> Plugin example </title>
+<body bgcolor="white">
+<h3> Current time is : </h3>
+<jsp:plugin type="applet" code="Clock2.class" codebase="applet" jreversion="1.2" width="160" height="150" >
+ <jsp:fallback>
+ Plugin tag OBJECT or EMBED not supported by browser.
+ </jsp:fallback>
+</jsp:plugin>
+<p>
+<h4>
+<font color=red>
+The above applet is loaded using the Java Plugin from a jsp page using the
+plugin tag.
+</font>
+</h4>
+</body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/security/protected/error.jsp b/tomcat-uid/webapps/examples/jsp/security/protected/error.jsp
new file mode 100644
index 0000000..50e0ed5
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/security/protected/error.jsp
@@ -0,0 +1,25 @@
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>Error Page For Examples</title>
+</head>
+<body bgcolor="white">
+Invalid username and/or password, please try
+<a href='<%= response.encodeURL("index.jsp") %>'>again</a>.
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/security/protected/error.jsp.html b/tomcat-uid/webapps/examples/jsp/security/protected/error.jsp.html
new file mode 100644
index 0000000..d45fb6c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/security/protected/error.jsp.html
@@ -0,0 +1,27 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>Error Page For Examples</title>
+</head>
+<body bgcolor="white">
+Invalid username and/or password, please try
+<a href='<%= response.encodeURL("index.jsp") %>'>again</a>.
+</body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/security/protected/index.jsp b/tomcat-uid/webapps/examples/jsp/security/protected/index.jsp
new file mode 100644
index 0000000..bef9700
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/security/protected/index.jsp
@@ -0,0 +1,81 @@
+<!--
+ 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.
+-->
+<%
+ if (request.getParameter("logoff") != null) {
+ session.invalidate();
+ response.sendRedirect("index.jsp");
+ return;
+ }
+%>
+<html>
+<head>
+<title>Protected Page for Examples</title>
+</head>
+<body bgcolor="white">
+
+You are logged in as remote user
+<b><%= util.HTMLFilter.filter(request.getRemoteUser()) %></b>
+in session <b><%= session.getId() %></b><br><br>
+
+<%
+ if (request.getUserPrincipal() != null) {
+%>
+ Your user principal name is
+ <b><%= util.HTMLFilter.filter(request.getUserPrincipal().getName()) %></b>
+ <br><br>
+<%
+ } else {
+%>
+ No user principal could be identified.<br><br>
+<%
+ }
+%>
+
+<%
+ String role = request.getParameter("role");
+ if (role == null)
+ role = "";
+ if (role.length() > 0) {
+ if (request.isUserInRole(role)) {
+%>
+ You have been granted role
+ <b><%= util.HTMLFilter.filter(role) %></b><br><br>
+<%
+ } else {
+%>
+ You have <i>not</i> been granted role
+ <b><%= util.HTMLFilter.filter(role) %></b><br><br>
+<%
+ }
+ }
+%>
+
+To check whether your username has been granted a particular role,
+enter it here:
+<form method="GET" action='<%= response.encodeURL("index.jsp") %>'>
+<input type="text" name="role" value="<%= util.HTMLFilter.filter(role) %>">
+</form>
+<br><br>
+
+If you have configured this app for form-based authentication, you can log
+off by clicking
+<a href='<%= response.encodeURL("index.jsp?logoff=true") %>'>here</a>.
+This should cause you to be returned to the logon page after the redirect
+that is performed.
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/security/protected/index.jsp.html b/tomcat-uid/webapps/examples/jsp/security/protected/index.jsp.html
new file mode 100644
index 0000000..b8a9a54
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/security/protected/index.jsp.html
@@ -0,0 +1,83 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%
+ if (request.getParameter("logoff") != null) {
+ session.invalidate();
+ response.sendRedirect("index.jsp");
+ return;
+ }
+%>
+<html>
+<head>
+<title>Protected Page for Examples</title>
+</head>
+<body bgcolor="white">
+
+You are logged in as remote user
+<b><%= util.HTMLFilter.filter(request.getRemoteUser()) %></b>
+in session <b><%= session.getId() %></b><br><br>
+
+<%
+ if (request.getUserPrincipal() != null) {
+%>
+ Your user principal name is
+ <b><%= util.HTMLFilter.filter(request.getUserPrincipal().getName()) %></b>
+ <br><br>
+<%
+ } else {
+%>
+ No user principal could be identified.<br><br>
+<%
+ }
+%>
+
+<%
+ String role = request.getParameter("role");
+ if (role == null)
+ role = "";
+ if (role.length() > 0) {
+ if (request.isUserInRole(role)) {
+%>
+ You have been granted role
+ <b><%= util.HTMLFilter.filter(role) %></b><br><br>
+<%
+ } else {
+%>
+ You have <i>not</i> been granted role
+ <b><%= util.HTMLFilter.filter(role) %></b><br><br>
+<%
+ }
+ }
+%>
+
+To check whether your username has been granted a particular role,
+enter it here:
+<form method="GET" action='<%= response.encodeURL("index.jsp") %>'>
+<input type="text" name="role" value="<%= util.HTMLFilter.filter(role) %>">
+</form>
+<br><br>
+
+If you have configured this app for form-based authentication, you can log
+off by clicking
+<a href='<%= response.encodeURL("index.jsp?logoff=true") %>'>here</a>.
+This should cause you to be returned to the logon page after the redirect
+that is performed.
+
+</body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/security/protected/login.jsp b/tomcat-uid/webapps/examples/jsp/security/protected/login.jsp
new file mode 100644
index 0000000..dc7e50e
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/security/protected/login.jsp
@@ -0,0 +1,38 @@
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>Login Page for Examples</title>
+<body bgcolor="white">
+<form method="POST" action='<%= response.encodeURL("j_security_check") %>' >
+ <table border="0" cellspacing="5">
+ <tr>
+ <th align="right">Username:</th>
+ <td align="left"><input type="text" name="j_username"></td>
+ </tr>
+ <tr>
+ <th align="right">Password:</th>
+ <td align="left"><input type="password" name="j_password"></td>
+ </tr>
+ <tr>
+ <td align="right"><input type="submit" value="Log In"></td>
+ <td align="left"><input type="reset"></td>
+ </tr>
+ </table>
+</form>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/security/protected/login.jsp.html b/tomcat-uid/webapps/examples/jsp/security/protected/login.jsp.html
new file mode 100644
index 0000000..94e16ef
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/security/protected/login.jsp.html
@@ -0,0 +1,40 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>Login Page for Examples</title>
+<body bgcolor="white">
+<form method="POST" action='<%= response.encodeURL("j_security_check") %>' >
+ <table border="0" cellspacing="5">
+ <tr>
+ <th align="right">Username:</th>
+ <td align="left"><input type="text" name="j_username"></td>
+ </tr>
+ <tr>
+ <th align="right">Password:</th>
+ <td align="left"><input type="password" name="j_password"></td>
+ </tr>
+ <tr>
+ <td align="right"><input type="submit" value="Log In"></td>
+ <td align="left"><input type="reset"></td>
+ </tr>
+ </table>
+</form>
+</body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/sessions/DummyCart.html b/tomcat-uid/webapps/examples/jsp/sessions/DummyCart.html
new file mode 100644
index 0000000..317523f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/sessions/DummyCart.html
@@ -0,0 +1,56 @@
+<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>
+sessions.DummyCart Bean Properties
+</title>
+<BODY BGCOLOR="white">
+<H2>
+sessions.DummyCart Bean Properties
+</H2>
+<HR>
+<DL>
+<DT>public class <B>DummyCart</B><DT>extends Object</DL>
+
+<P>
+<HR>
+
+<P>
+
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0">
+<TR BGCOLOR="#EEEEFF">
+<TD COLSPAN=3><FONT SIZE="+2">
+<B>Properties Summary</B></FONT></TD>
+</TR>
+<TR BGCOLOR="white">
+<td align="right" valign="top" width="1%">
+<FONT SIZE="-1">
+String
+</FONT></TD>
+<TD><B>DummyCart:items</B>
+<BR>
+ </TD>
+<td width="1%">
+<FONT SIZE="-1">
+Multi
+</FONT></TD>
+</TABLE>
+<HR>
+</BODY>
+</HTML>
diff --git a/tomcat-uid/webapps/examples/jsp/sessions/carts.html b/tomcat-uid/webapps/examples/jsp/sessions/carts.html
new file mode 100644
index 0000000..fe7dbb5
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/sessions/carts.html
@@ -0,0 +1,53 @@
+<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>carts</title>
+</head>
+
+ <body bgcolor="white">
+<font size = 5 color="#CC0000">
+
+<form type=POST action=carts.jsp>
+<BR>
+Please enter item to add or remove:
+<br>
+Add Item:
+
+<SELECT NAME="item">
+<OPTION>Beavis & Butt-head Video collection
+<OPTION>X-files movie
+<OPTION>Twin peaks tapes
+<OPTION>NIN CD
+<OPTION>JSP Book
+<OPTION>Concert tickets
+<OPTION>Love life
+<OPTION>Switch blade
+<OPTION>Rex, Rugs & Rock n' Roll
+</SELECT>
+
+
+<br> <br>
+<INPUT TYPE=submit name="submit" value="add">
+<INPUT TYPE=submit name="submit" value="remove">
+
+</form>
+
+</FONT>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/sessions/carts.jsp b/tomcat-uid/webapps/examples/jsp/sessions/carts.jsp
new file mode 100644
index 0000000..e84170a
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/sessions/carts.jsp
@@ -0,0 +1,44 @@
+<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.
+-->
+
+<jsp:useBean id="cart" scope="session" class="sessions.DummyCart" />
+
+<jsp:setProperty name="cart" property="*" />
+<%
+ cart.processRequest();
+%>
+
+
+<FONT size = 5 COLOR="#CC0000">
+<br> You have the following items in your cart:
+<ol>
+<%
+ String[] items = cart.getItems();
+ for (int i=0; i<items.length; i++) {
+%>
+<li> <% out.print(util.HTMLFilter.filter(items[i])); %>
+<%
+ }
+%>
+</ol>
+
+</FONT>
+
+<hr>
+<%@ include file ="carts.html" %>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/sessions/carts.jsp.html b/tomcat-uid/webapps/examples/jsp/sessions/carts.jsp.html
new file mode 100644
index 0000000..92d40c9
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/sessions/carts.jsp.html
@@ -0,0 +1,46 @@
+<html><body><pre>
+<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.
+-->
+
+<jsp:useBean id="cart" scope="session" class="sessions.DummyCart" />
+
+<jsp:setProperty name="cart" property="*" />
+<%
+ cart.processRequest();
+%>
+
+
+<FONT size = 5 COLOR="#CC0000">
+<br> You have the following items in your cart:
+<ol>
+<%
+ String[] items = cart.getItems();
+ for (int i=0; i<items.length; i++) {
+%>
+<li> <% out.print(util.HTMLFilter.filter(items[i])); %>
+<%
+ }
+%>
+</ol>
+
+</FONT>
+
+<hr>
+<%@ include file ="carts.html" %>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/sessions/crt.html b/tomcat-uid/webapps/examples/jsp/sessions/crt.html
new file mode 100644
index 0000000..28804e9
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/sessions/crt.html
@@ -0,0 +1,34 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="carts.html"><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><a href="carts.jsp.html">Source Code for Cart Example<font color="#0000FF"></a>
+ </font> </h3>
+
+<h3><a href="DummyCart.html">Property Sheet for DummyCart
+<font color="#0000FF"></a> </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/simpletag/foo.html b/tomcat-uid/webapps/examples/jsp/simpletag/foo.html
new file mode 100644
index 0000000..334b6bc
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/simpletag/foo.html
@@ -0,0 +1,30 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="foo.jsp"><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><a href="foo.jsp.html">Source Code for the Simple Tag Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/simpletag/foo.jsp b/tomcat-uid/webapps/examples/jsp/simpletag/foo.jsp
new file mode 100644
index 0000000..19ff087
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/simpletag/foo.jsp
@@ -0,0 +1,38 @@
+<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.
+-->
+<body>
+<%@ taglib uri="http://tomcat.apache.org/examples-taglib" prefix="eg"%>
+
+Radio stations that rock:
+
+<ul>
+<eg:foo att1="98.5" att2="92.3" att3="107.7">
+<li><%= member %></li>
+</eg:foo>
+</ul>
+
+<eg:log>
+Did you see me on the stderr window?
+</eg:log>
+
+<eg:log toBrowser="true">
+Did you see me on the browser window as well?
+</eg:log>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/simpletag/foo.jsp.html b/tomcat-uid/webapps/examples/jsp/simpletag/foo.jsp.html
new file mode 100644
index 0000000..ce7fb97
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/simpletag/foo.jsp.html
@@ -0,0 +1,40 @@
+<html><body><pre>
+<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.
+-->
+<body>
+<%@ taglib uri="http://tomcat.apache.org/examples-taglib" prefix="eg"%>
+
+Radio stations that rock:
+
+<ul>
+<eg:foo att1="98.5" att2="92.3" att3="107.7">
+<li><%= member %></li>
+</eg:foo>
+</ul>
+
+<eg:log>
+Did you see me on the stderr window?
+</eg:log>
+
+<eg:log toBrowser="true">
+Did you see me on the browser window as well?
+</eg:log>
+
+</body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/snp/snoop.html b/tomcat-uid/webapps/examples/jsp/snp/snoop.html
new file mode 100644
index 0000000..c00aca7
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/snp/snoop.html
@@ -0,0 +1,31 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="snoop.jsp"><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><a href="snoop.jsp.html">Source Code for Request Parameters Example<font color="#0000FF">
+ </font></a></h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/snp/snoop.jsp b/tomcat-uid/webapps/examples/jsp/snp/snoop.jsp
new file mode 100644
index 0000000..06a3830
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/snp/snoop.jsp
@@ -0,0 +1,57 @@
+<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.
+-->
+
+<body bgcolor="white">
+<h1> Request Information </h1>
+<font size="4">
+JSP Request Method: <%= util.HTMLFilter.filter(request.getMethod()) %>
+<br>
+Request URI: <%= util.HTMLFilter.filter(request.getRequestURI()) %>
+<br>
+Request Protocol: <%= util.HTMLFilter.filter(request.getProtocol()) %>
+<br>
+Servlet path: <%= util.HTMLFilter.filter(request.getServletPath()) %>
+<br>
+Path info: <%= util.HTMLFilter.filter(request.getPathInfo()) %>
+<br>
+Query string: <%= util.HTMLFilter.filter(request.getQueryString()) %>
+<br>
+Content length: <%= request.getContentLength() %>
+<br>
+Content type: <%= util.HTMLFilter.filter(request.getContentType()) %>
+<br>
+Server name: <%= util.HTMLFilter.filter(request.getServerName()) %>
+<br>
+Server port: <%= request.getServerPort() %>
+<br>
+Remote user: <%= util.HTMLFilter.filter(request.getRemoteUser()) %>
+<br>
+Remote address: <%= util.HTMLFilter.filter(request.getRemoteAddr()) %>
+<br>
+Remote host: <%= util.HTMLFilter.filter(request.getRemoteHost()) %>
+<br>
+Authorization scheme: <%= util.HTMLFilter.filter(request.getAuthType()) %>
+<br>
+Locale: <%= request.getLocale() %>
+<hr>
+The browser you are using is
+<%= util.HTMLFilter.filter(request.getHeader("User-Agent")) %>
+<hr>
+</font>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/snp/snoop.jsp.html b/tomcat-uid/webapps/examples/jsp/snp/snoop.jsp.html
new file mode 100644
index 0000000..13025fb
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/snp/snoop.jsp.html
@@ -0,0 +1,59 @@
+<html><body><pre>
+<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.
+-->
+
+<body bgcolor="white">
+<h1> Request Information </h1>
+<font size="4">
+JSP Request Method: <%= util.HTMLFilter.filter(request.getMethod()) %>
+<br>
+Request URI: <%= util.HTMLFilter.filter(request.getRequestURI()) %>
+<br>
+Request Protocol: <%= util.HTMLFilter.filter(request.getProtocol()) %>
+<br>
+Servlet path: <%= util.HTMLFilter.filter(request.getServletPath()) %>
+<br>
+Path info: <%= util.HTMLFilter.filter(request.getPathInfo()) %>
+<br>
+Query string: <%= util.HTMLFilter.filter(request.getQueryString()) %>
+<br>
+Content length: <%= request.getContentLength() %>
+<br>
+Content type: <%= util.HTMLFilter.filter(request.getContentType()) %>
+<br>
+Server name: <%= util.HTMLFilter.filter(request.getServerName()) %>
+<br>
+Server port: <%= request.getServerPort() %>
+<br>
+Remote user: <%= util.HTMLFilter.filter(request.getRemoteUser()) %>
+<br>
+Remote address: <%= util.HTMLFilter.filter(request.getRemoteAddr()) %>
+<br>
+Remote host: <%= util.HTMLFilter.filter(request.getRemoteHost()) %>
+<br>
+Authorization scheme: <%= util.HTMLFilter.filter(request.getAuthType()) %>
+<br>
+Locale: <%= request.getLocale() %>
+<hr>
+The browser you are using is
+<%= util.HTMLFilter.filter(request.getHeader("User-Agent")) %>
+<hr>
+</font>
+</body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/source.jsp b/tomcat-uid/webapps/examples/jsp/source.jsp
new file mode 100644
index 0000000..efa329a
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/source.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.
+-->
+<%@ taglib uri="http://tomcat.apache.org/examples-taglib"
+ prefix="eg" %>
+
+<eg:ShowSource jspFile="<%= util.HTMLFilter.filter(request.getQueryString()) %>"/>
diff --git a/tomcat-uid/webapps/examples/jsp/source.jsp.html b/tomcat-uid/webapps/examples/jsp/source.jsp.html
new file mode 100644
index 0000000..841dd3f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/source.jsp.html
@@ -0,0 +1,22 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<%@ taglib uri="http://tomcat.apache.org/examples-taglib"
+ prefix="eg" %>
+
+<eg:ShowSource jspFile="<%= util.HTMLFilter.filter(request.getQueryString()) %>"/>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/tagplugin/choose.html b/tomcat-uid/webapps/examples/jsp/tagplugin/choose.html
new file mode 100644
index 0000000..fdec617
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/tagplugin/choose.html
@@ -0,0 +1,36 @@
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>View Source Code</title>
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF">
+ <a href="choose.jsp">
+ <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>
+ <a href="choose.jsp.html">Source Code for choose.jsp<font color="#0000FF"/></a>
+</h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/tagplugin/choose.jsp b/tomcat-uid/webapps/examples/jsp/tagplugin/choose.jsp
new file mode 100644
index 0000000..2427249
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/tagplugin/choose.jsp
@@ -0,0 +1,58 @@
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>Tag Examples - choose</title>
+ </head>
+ <body>
+ <h1>Tag Plugin Examples - <c:choose></h1>
+
+ <hr>
+ </br>
+ <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></
+a>
+ <br/>
+ <a href="howto.html">Brief Instructions for Writing Plugins<font color="#000
+0
+FF"></a>
+ <br/> <br/>
+ <hr>
+
+ <font color="#000000"/>
+ </br>
+
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+ <c:forEach var="index" begin="0" end="4">
+ # ${index}:
+ <c:choose>
+ <c:when test="${index == 1}">
+ One!</br>
+ </c:when>
+ <c:when test="${index == 4}">
+ Four!</br>
+ </c:when>
+ <c:when test="${index == 3}">
+ Three!</br>
+ </c:when>
+ <c:otherwise>
+ Huh?</br>
+ </c:otherwise>
+ </c:choose>
+ </c:forEach>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/tagplugin/choose.jsp.html b/tomcat-uid/webapps/examples/jsp/tagplugin/choose.jsp.html
new file mode 100644
index 0000000..d95ab00
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/tagplugin/choose.jsp.html
@@ -0,0 +1,60 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>Tag Examples - choose</title>
+ </head>
+ <body>
+ <h1>Tag Plugin Examples - &lt;c:choose></h1>
+
+ <hr>
+ </br>
+ <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></
+a>
+ <br/>
+ <a href="howto.html">Brief Instructions for Writing Plugins<font color="#000
+0
+FF"></a>
+ <br/> <br/>
+ <hr>
+
+ <font color="#000000"/>
+ </br>
+
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+ <c:forEach var="index" begin="0" end="4">
+ # ${index}:
+ <c:choose>
+ <c:when test="${index == 1}">
+ One!</br>
+ </c:when>
+ <c:when test="${index == 4}">
+ Four!</br>
+ </c:when>
+ <c:when test="${index == 3}">
+ Three!</br>
+ </c:when>
+ <c:otherwise>
+ Huh?</br>
+ </c:otherwise>
+ </c:choose>
+ </c:forEach>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/tagplugin/foreach.html b/tomcat-uid/webapps/examples/jsp/tagplugin/foreach.html
new file mode 100644
index 0000000..f1a9c1d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/tagplugin/foreach.html
@@ -0,0 +1,36 @@
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>View Source Code</title>
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF">
+ <a href="foreach.jsp">
+ <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>
+ <a href="foreach.jsp.html">Source Code for foreach.jsp<font color="#0000FF"/></a>
+</h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/tagplugin/foreach.jsp b/tomcat-uid/webapps/examples/jsp/tagplugin/foreach.jsp
new file mode 100644
index 0000000..135d5ed
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/tagplugin/foreach.jsp
@@ -0,0 +1,57 @@
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>Tag Plugin Examples: forEach</title>
+ </head>
+ <body>
+ <h1>Tag Plugin Examples - <c:forEach></h1>
+
+ <hr>
+ </br>
+ <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></
+a>
+ <br/>
+ <a href="howto.html">Brief Instructions for Writing Plugins<font color="#0000
+FF"></a>
+ <br/> <br/>
+ <hr>
+
+ <font color="#000000"/>
+ </br>
+
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+ <%@ page import="java.util.Vector" %>
+
+ <h3>Iterating over a range</h3>
+ <c:forEach var="item" begin="1" end="10">
+ ${item}
+ </c:forEach>
+
+ <% Vector v = new Vector();
+ v.add("One"); v.add("Two"); v.add("Three"); v.add("Four");
+
+ pageContext.setAttribute("vector", v);
+ %>
+
+ <h3>Iterating over a Vector</h3>
+
+ <c:forEach items="${vector}" var="item" >
+ ${item}
+ </c:forEach>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/tagplugin/foreach.jsp.html b/tomcat-uid/webapps/examples/jsp/tagplugin/foreach.jsp.html
new file mode 100644
index 0000000..1d153c1
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/tagplugin/foreach.jsp.html
@@ -0,0 +1,59 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>Tag Plugin Examples: forEach</title>
+ </head>
+ <body>
+ <h1>Tag Plugin Examples - &lt;c:forEach></h1>
+
+ <hr>
+ </br>
+ <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></
+a>
+ <br/>
+ <a href="howto.html">Brief Instructions for Writing Plugins<font color="#0000
+FF"></a>
+ <br/> <br/>
+ <hr>
+
+ <font color="#000000"/>
+ </br>
+
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+ <%@ page import="java.util.Vector" %>
+
+ <h3>Iterating over a range</h3>
+ <c:forEach var="item" begin="1" end="10">
+ ${item}
+ </c:forEach>
+
+ <% Vector v = new Vector();
+ v.add("One"); v.add("Two"); v.add("Three"); v.add("Four");
+
+ pageContext.setAttribute("vector", v);
+ %>
+
+ <h3>Iterating over a Vector</h3>
+
+ <c:forEach items="${vector}" var="item" >
+ ${item}
+ </c:forEach>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/tagplugin/howto.html b/tomcat-uid/webapps/examples/jsp/tagplugin/howto.html
new file mode 100644
index 0000000..02e746d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/tagplugin/howto.html
@@ -0,0 +1,45 @@
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>Tag Plugin Implementation</title>
+ </head>
+ <body>
+ <h2>How to write tag plugins</h2>
+ <p>
+ To write a plugin, you'll need to download the source for Tomcat 5.
+ There are two steps:
+ <ol>
+ <li>
+ Implement the plugin class.<p/>
+ This class, which implements
+ <tt>org.apache.jasper.compiler.tagplugin.TagPlugin</tt>
+ instructs Jasper what Java codes to generate in place of the tag
+ handler calls.
+ See Javadoc for <tt>org.apache.jasper.compiler.tagplugin.TagPlugin</tt>
+ for details.
+ </li>
+
+ <li>
+ Create the plugin descriptor file <tt> WEB-INF/tagPlugins.xml</tt><p/>
+ This file
+ specifies the plugin classes and their corresponding tag handler
+ classes.
+ </li>
+ </ol>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/tagplugin/if.html b/tomcat-uid/webapps/examples/jsp/tagplugin/if.html
new file mode 100644
index 0000000..a338e17
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/tagplugin/if.html
@@ -0,0 +1,36 @@
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>View Source Code</title>
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF">
+ <a href="if.jsp">
+ <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>
+ <a href="if.jsp.html">Source Code for if.jsp<font color="#0000FF"/></a>
+</h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/tagplugin/if.jsp b/tomcat-uid/webapps/examples/jsp/tagplugin/if.jsp
new file mode 100644
index 0000000..ad9414a
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/tagplugin/if.jsp
@@ -0,0 +1,45 @@
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>Tag Plugin Examples: if</title>
+ </head>
+ <body>
+ <h1>Tag Plugin Examples - <c:if></h1>
+
+ <hr>
+ </br>
+ <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></a>
+ <br/>
+ <a href="howto.html">Brief Instructions for Writing Plugins<font color="#0000FF"></a>
+ <br/> <br/>
+ <hr>
+
+ <font color="#000000"/>
+ </br>
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+ <h3>Set the test result to a variable</h3>
+ <c:if test="${1==1}" var="theTruth" scope="session"/>
+ The result of testing for (1==1) is: ${theTruth}
+
+ <h3>Conditionally execute the body</h3>
+ <c:if test="${2>0}">
+ It's true that (2>0)!
+ </c:if>
+ </body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/tagplugin/if.jsp.html b/tomcat-uid/webapps/examples/jsp/tagplugin/if.jsp.html
new file mode 100644
index 0000000..efcefe4
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/tagplugin/if.jsp.html
@@ -0,0 +1,47 @@
+<html><body><pre>
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>Tag Plugin Examples: if</title>
+ </head>
+ <body>
+ <h1>Tag Plugin Examples - &lt;c:if></h1>
+
+ <hr>
+ </br>
+ <a href="notes.html">Plugin Introductory Notes<font <font color="#0000FF"></a>
+ <br/>
+ <a href="howto.html">Brief Instructions for Writing Plugins<font color="#0000FF"></a>
+ <br/> <br/>
+ <hr>
+
+ <font color="#000000"/>
+ </br>
+ <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+ <h3>Set the test result to a variable</h3>
+ <c:if test="${1==1}" var="theTruth" scope="session"/>
+ The result of testing for (1==1) is: ${theTruth}
+
+ <h3>Conditionally execute the body</h3>
+ <c:if test="${2>0}">
+ It's true that (2>0)!
+ </c:if>
+ </body>
+</html>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/jsp/tagplugin/notes.html b/tomcat-uid/webapps/examples/jsp/tagplugin/notes.html
new file mode 100644
index 0000000..281a74c
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/tagplugin/notes.html
@@ -0,0 +1,41 @@
+<!--
+ 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.
+-->
+<html>
+ <head>
+ <title>Tag Plugin Introduction</title>
+ </head>
+ <body>
+ <h2>Tag Plugins: Introductory Notes</h2>
+ <p>
+ Tomcat 5 provides a framework for implementing tag plugins. The
+ plugins instruct Jasper, at translation time, to replace tag handler
+ calls with Java scriptlets.
+ The framework allows tag library authors to implement plugins for
+ their tags.
+ </p>
+ <p>
+ Tomcat 5 is released with plugins for several JSTL tags. Note
+ that these plugins work with JSTL 1.1 as well as JSTL 1.0, though
+ the examples uses JSTL 1.1 and JSP 2.0.
+ These plugins are not complete (for instance, some item types not
+ handled in <c:if>).
+ They do serve as examples to show plugins in action (just
+ examine the generated Java files), and how they can be implemented.
+ </p>
+ </body>
+</html>
+
diff --git a/tomcat-uid/webapps/examples/jsp/xml/xml.html b/tomcat-uid/webapps/examples/jsp/xml/xml.html
new file mode 100644
index 0000000..80907a5
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/xml/xml.html
@@ -0,0 +1,31 @@
+<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>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="xml.jsp"><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><a href="xml.jsp.html">Source Code for XML syntax Example<font color="#0000FF"></a>
+ </font> </h3>
+
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/jsp/xml/xml.jsp b/tomcat-uid/webapps/examples/jsp/xml/xml.jsp
new file mode 100644
index 0000000..e7ff43b
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/xml/xml.jsp
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
+ version="1.2">
+<jsp:directive.page contentType="text/html"/>
+<jsp:directive.page import="java.util.Date, java.util.Locale"/>
+<jsp:directive.page import="java.text.*"/>
+
+<jsp:declaration>
+ String getDateTimeStr(Locale l) {
+ DateFormat df = SimpleDateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, l);
+ return df.format(new Date());
+ }
+</jsp:declaration>
+
+<html>
+<head>
+ <title>Example JSP in XML format</title>
+</head>
+
+<body>
+This is the output of a simple JSP using XML format.
+<br />
+
+<div>Use a jsp:scriptlet to loop from 1 to 10: </div>
+<jsp:scriptlet>
+// Note we need to declare CDATA because we don't escape the less than symbol
+<![CDATA[
+ for (int i = 1; i<=10; i++) {
+ out.println(i);
+ if (i < 10) {
+ out.println(", ");
+ }
+ }
+]]>
+</jsp:scriptlet>
+
+<!-- Because I omit br's end tag, declare it as CDATA -->
+<![CDATA[
+ <br><br>
+]]>
+
+<div align="left">
+ Use a jsp:expression to write the date and time in the browser's locale:
+ <jsp:expression>getDateTimeStr(request.getLocale())</jsp:expression>
+</div>
+
+
+<jsp:text>
+ <p>This sentence is enclosed in a jsp:text element.</p>
+</jsp:text>
+
+</body>
+</html>
+</jsp:root>
diff --git a/tomcat-uid/webapps/examples/jsp/xml/xml.jsp.html b/tomcat-uid/webapps/examples/jsp/xml/xml.jsp.html
new file mode 100644
index 0000000..00d2980
--- /dev/null
+++ b/tomcat-uid/webapps/examples/jsp/xml/xml.jsp.html
@@ -0,0 +1,72 @@
+<html><body><pre>
+<?xml version="1.0"?>
+<!--
+ 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.
+-->
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
+ version="1.2">
+<jsp:directive.page contentType="text/html"/>
+<jsp:directive.page import="java.util.Date, java.util.Locale"/>
+<jsp:directive.page import="java.text.*"/>
+
+<jsp:declaration>
+ String getDateTimeStr(Locale l) {
+ DateFormat df = SimpleDateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, l);
+ return df.format(new Date());
+ }
+</jsp:declaration>
+
+<html>
+<head>
+ <title>Example JSP in XML format</title>
+</head>
+
+<body>
+This is the output of a simple JSP using XML format.
+<br />
+
+<div>Use a jsp:scriptlet to loop from 1 to 10: </div>
+<jsp:scriptlet>
+// Note we need to declare CDATA because we don't escape the less than symbol
+<![CDATA[
+ for (int i = 1; i<=10; i++) {
+ out.println(i);
+ if (i < 10) {
+ out.println(", ");
+ }
+ }
+]]>
+</jsp:scriptlet>
+
+<!-- Because I omit br's end tag, declare it as CDATA -->
+<![CDATA[
+ <br><br>
+]]>
+
+<div align="left">
+ Use a jsp:expression to write the date and time in the browser's locale:
+ <jsp:expression>getDateTimeStr(request.getLocale())</jsp:expression>
+</div>
+
+
+<jsp:text>
+ &lt;p&gt;This sentence is enclosed in a jsp:text element.&lt;/p&gt;
+</jsp:text>
+
+</body>
+</html>
+</jsp:root>
+</pre></body></html>
diff --git a/tomcat-uid/webapps/examples/servlets/cookies.html b/tomcat-uid/webapps/examples/servlets/cookies.html
new file mode 100644
index 0000000..659a26d
--- /dev/null
+++ b/tomcat-uid/webapps/examples/servlets/cookies.html
@@ -0,0 +1,61 @@
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<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>
+<pre><font color="#0000FF">import</font> java.io.*;
+<font color="#0000FF">import</font> javax.servlet.*;
+<font color="#0000FF">import</font> javax.servlet.http.*;
+
+<font color="#0000FF">public class</font> CookieExample <font color="#0000FF">extends</font> HttpServlet {
+
+ <font color="#0000FF">public void</font> doGet(HttpServletRequest request, HttpServletResponse response)
+ <font color="#0000FF">throws</font> IOException, ServletException
+ {
+ response.setContentType("<font color="#009900">text/html</font>");
+ PrintWriter out = response.getWriter();
+
+ <font color="#CC0000">// print out cookies</font>
+
+ Cookie[] cookies = request.getCookies();
+ for (int i = 0; i < cookies.length; i++) {
+ Cookie c = cookies[i];
+ String name = c.getName();
+ String value = c.getValue();
+ out.println(name + "<font color="#009900"> = </font>" + value);
+ }
+
+ <font color="#CC0000">// set a cookie</font>
+
+ String name = request.getParameter("<font color="#009900">cookieName</font>");
+ if (name != null && name.length() > 0) {
+ String value = request.getParameter("<font color="#009900">cookieValue</font>");
+ Cookie c = new Cookie(name, value);
+ response.addCookie(c);
+ }
+ }
+}</pre>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/servlets/helloworld.html b/tomcat-uid/webapps/examples/servlets/helloworld.html
new file mode 100644
index 0000000..e30810a
--- /dev/null
+++ b/tomcat-uid/webapps/examples/servlets/helloworld.html
@@ -0,0 +1,50 @@
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="servlet/HelloWorldExample"><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 HelloWorld Example<font color="#0000FF"><br>
+ </font> </h3>
+<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.*;
+
+<font color="#0000FF">public class</font> HelloWorld <font color="#0000FF">extends</font> HttpServlet {
+
+ <font color="#0000FF">public void</font> doGet(HttpServletRequest request, HttpServletResponse response)
+ <font color="#0000FF">throws</font> IOException, ServletException
+ {
+ response.setContentType("<font color="#009900">text/html</font>");
+ PrintWriter out = response.getWriter();
+ out.println("<font color="#009900"><html></font>");
+ out.println("<font color="#009900"><head></font>");
+ out.println("<font color="#009900"><title>Hello World!</title></font>");
+ out.println("<font color="#009900"></head></font>");
+ out.println("<font color="#009900"><body></font>");
+ out.println("<font color="#009900"><h1>Hello World!</h1></font>");
+ out.println("<font color="#009900"></body></font>");
+ out.println("<font color="#009900"></html></font>");
+ }
+}</pre>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/servlets/images/code.gif b/tomcat-uid/webapps/examples/servlets/images/code.gif
new file mode 100644
index 0000000..93af2cd
--- /dev/null
+++ b/tomcat-uid/webapps/examples/servlets/images/code.gif
Binary files differ
diff --git a/tomcat-uid/webapps/examples/servlets/images/execute.gif b/tomcat-uid/webapps/examples/servlets/images/execute.gif
new file mode 100644
index 0000000..f64d70f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/servlets/images/execute.gif
Binary files differ
diff --git a/tomcat-uid/webapps/examples/servlets/images/return.gif b/tomcat-uid/webapps/examples/servlets/images/return.gif
new file mode 100644
index 0000000..af4f68f
--- /dev/null
+++ b/tomcat-uid/webapps/examples/servlets/images/return.gif
Binary files differ
diff --git a/tomcat-uid/webapps/examples/servlets/index.html b/tomcat-uid/webapps/examples/servlets/index.html
new file mode 100644
index 0000000..b778706
--- /dev/null
+++ b/tomcat-uid/webapps/examples/servlets/index.html
@@ -0,0 +1,121 @@
+<!--
+ 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.0 transitional//en">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="GENERATOR" content="Mozilla/4.61 [en] (WinNT; I) [Netscape]">
+ <meta name="Author" content="Anil K. Vijendran">
+ <title>Servlet Examples</title>
+</head>
+<body bgcolor="#FFFFFF">
+<b><font face="Arial, Helvetica, sans-serif"><font size=+2>Servlet
+Examples with Code</font></font></b>
+<p>This is a collection of examples which demonstrate some of the more
+frequently used parts of the Servlet API. Familiarity with the Java(tm)
+Programming Language is assumed.
+<p>These examples will only work when viewed via an http URL. They will
+not work if you are viewing these pages via a "file://..." URL. Please
+refer to the <i>README</i> file provide with this Tomcat release regarding
+how to configure and start the provided web server.
+<p>Wherever you see a form, enter some data and see how the servlet reacts.
+When playing with the Cookie and Session Examples, jump back to the Headers
+Example to see exactly what your browser is sending the server.
+<p>To navigate your way through the examples, the following icons will
+help:
+<br>
+<table BORDER=0 CELLSPACING=5 WIDTH="85%" >
+<tr VALIGN=TOP>
+<td WIDTH="30"><img SRC="images/execute.gif" ></td>
+
+<td>Execute the example</td>
+</tr>
+
+<tr VALIGN=TOP>
+<td WIDTH="30"><img SRC="images/code.gif" height=24 width=24></td>
+
+<td>Look at the source code for the example</td>
+</tr>
+
+<tr VALIGN=TOP>
+<td WIDTH="30"><img SRC="images/return.gif" height=24 width=24></td>
+
+<td>Return to this screen</td>
+</tr>
+</table>
+
+<p>Tip: To see the cookie interactions with your browser, try turning on
+the "notify when setting a cookie" option in your browser preferences.
+This will let you see when a session is created and give some feedback
+when looking at the cookie demo.
+<br>
+<table BORDER=0 CELLSPACING=5 WIDTH="85%" >
+<tr VALIGN=TOP>
+<td>Hello World</td>
+
+<td VALIGN=TOP WIDTH="30%"><a href="servlet/HelloWorldExample"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="servlet/HelloWorldExample">Execute</a></td>
+
+<td WIDTH="30%"><a href="helloworld.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="helloworld.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Request Info</td>
+
+<td WIDTH="30%"><a href="servlet/RequestInfoExample"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="servlet/RequestInfoExample">Execute</a></td>
+
+<td WIDTH="30%"><a href="reqinfo.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="reqinfo.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Request Headers</td>
+
+<td WIDTH="30%"><a href="servlet/RequestHeaderExample"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="servlet/RequestHeaderExample">Execute</a></td>
+
+<td WIDTH="30%"><a href="reqheaders.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="reqheaders.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Request Parameters</td>
+
+<td WIDTH="30%"><a href="servlet/RequestParamExample"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="servlet/RequestParamExample">Execute</a></td>
+
+<td WIDTH="30%"><a href="reqparams.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="reqparams.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Cookies</td>
+
+<td WIDTH="30%"><a href="servlet/CookieExample"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="servlet/CookieExample">Execute</a></td>
+
+<td WIDTH="30%"><a href="cookies.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="cookies.html">Source</a></td>
+</tr>
+
+<tr VALIGN=TOP>
+<td>Sessions</td>
+
+<td WIDTH="30%"><a href="servlet/SessionExample"><img SRC="images/execute.gif" HSPACE=4 BORDER=0 align=TOP></a><a href="servlet/SessionExample">Execute</a></td>
+
+<td WIDTH="30%"><a href="sessions.html"><img SRC="images/code.gif" HSPACE=4 BORDER=0 height=24 width=24 align=TOP></a><a href="sessions.html">Source</a></td>
+</tr>
+</table>
+
+<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.
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/servlets/reqheaders.html b/tomcat-uid/webapps/examples/servlets/reqheaders.html
new file mode 100644
index 0000000..4cb80c2
--- /dev/null
+++ b/tomcat-uid/webapps/examples/servlets/reqheaders.html
@@ -0,0 +1,49 @@
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<p><font color="#0000FF"><a href="servlet/RequestHeaderExample"><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 RequestHeader Example<font color="#0000FF"><br>
+ </font> </h3>
+<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.*;
+<font color="#0000FF">import</font> javax.servlet.http.*;
+
+<font color="#0000FF">public class</font> RequestHeaderExample <font color="#0000FF">extends</font> HttpServlet {
+
+ <font color="#0000FF">public void</font> doGet(HttpServletRequest request, HttpServletResponse response)
+ <font color="#0000FF">throws</font> IOException, ServletException
+ {
+ response.setContentType("<font color="#009900">text/html</font>");
+ PrintWriter out = response.getWriter();
+ Enumeration e = request.getHeaderNames();
+ while (e.hasMoreElements()) {
+ String name = (String)e.nextElement();
+ String value = request.getHeader(name);
+ out.println(name + "<font color="#009900"> = </font>" + value);
+ }
+ }
+}</pre>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/servlets/reqinfo.html b/tomcat-uid/webapps/examples/servlets/reqinfo.html
new file mode 100644
index 0000000..4ac664b
--- /dev/null
+++ b/tomcat-uid/webapps/examples/servlets/reqinfo.html
@@ -0,0 +1,68 @@
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<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>
+<pre><font color="#0000FF">import</font> java.io.*;
+<font color="#0000FF">import</font> javax.servlet.*;
+<font color="#0000FF">import</font> javax.servlet.http.*;
+
+<font color="#0000FF">public class</font> RequestInfo <font color="#0000FF">extends</font> HttpServlet {
+
+ <font color="#0000FF">public void</font> doGet(HttpServletRequest request, HttpServletResponse response)
+ <font color="#0000FF">throws</font> IOException, ServletException
+ {
+ response.setContentType("<font color="#009900">text/html</font>");
+ PrintWriter out = response.getWriter();
+ out.println("<font color="#009900"><html></font>");
+ out.println("<font color="#009900"><body></font>");
+ out.println("<font color="#009900"><head></font>");
+ out.println("<font color="#009900"><title>Request Information Example</title></font>");
+ out.println("<font color="#009900"></head></font>");
+ out.println("<font color="#009900"><body></font>");
+ out.println("<font color="#009900"><h3>Request Information Example</h3></font>");
+ out.println("<font color="#009900">Method: </font>" + request.getMethod());
+ out.println("<font color="#009900">Request URI: </font>" + request.getRequestURI());
+ out.println("<font color="#009900">Protocol: </font>" + request.getProtocol());
+ out.println("<font color="#009900">PathInfo: </font>" + request.getPathInfo());
+ out.println("<font color="#009900">Remote Address: </font>" + request.getRemoteAddr());
+ out.println("<font color="#009900"></body></font>");
+ out.println("<font color="#009900"></html></font>");
+ }
+
+<font color="#FF0000"> /**
+ * We are going to perform the same operations for POST requests
+ * as for GET methods, so this method just sends the request to
+ * the doGet method.
+ */</font>
+
+ <font color="#0000FF">public void</font> doPost(HttpServletRequest request, HttpServletResponse response)
+ <font color="#0000FF">throws</font> IOException, ServletException
+ {
+ doGet(request, response);
+ }
+}</pre>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/servlets/reqparams.html b/tomcat-uid/webapps/examples/servlets/reqparams.html
new file mode 100644
index 0000000..b0de031
--- /dev/null
+++ b/tomcat-uid/webapps/examples/servlets/reqparams.html
@@ -0,0 +1,78 @@
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<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>
+<pre><font color="#0000FF">import</font> java.io.*;
+<font color="#0000FF">import</font> java.util.*;
+<font color="#0000FF">import</font> javax.servlet.*;
+<font color="#0000FF">import</font> javax.servlet.http.*;
+
+<font color="#0000FF">public class</font> RequestParamExample <font color="#0000FF">extends</font> HttpServlet {
+
+ <font color="#0000FF">public void</font> doGet(HttpServletRequest request, HttpServletResponse response)
+ <font color="#0000FF">throws</font> IOException, ServletException
+ {
+ response.setContentType("<font color="#009900">text/html</font>");
+ PrintWriter out = response.getWriter();
+ out.println("<font color="#009900"><html></font>");
+ out.println("<font color="#009900"><head></font>");
+ out.println("<font color="#009900"><title>Request Parameters Example</title></font>");
+ out.println("<font color="#009900"></head></font>");
+ out.println("<font color="#009900"><body></font>");
+ out.println("<font color="#009900"><h3>Request Parameters Example</h3></font>");
+ out.println("<font color="#009900">Parameters in this request:<br></font>");
+ if (firstName != null || lastName != null) {
+ out.println("<font color="#009900">First Name:</font>");
+ out.println("<font color="#009900"> = </font>" + HTMLFilter.filter(firstName) + "<font color="#009900"><br></font>");
+ out.println("<font color="#009900">Last Name:</font>");
+ out.println("<font color="#009900"> = </font>" + HTMLFilter.filter(lastName));
+ } else {
+ out.println("<font color="#009900">No Parameters, Please enter some</font>");
+ }
+ out.println("<font color="#009900"><P></font>");
+ out.print("<font color="#009900"><form action=\"</font>");
+ out.print("<font color="#009900">RequestParamExample\" </font>");
+ out.println("<font color="#009900">method=POST></font>");
+ out.println("<font color="#009900">First Name:</font>");
+ out.println("<font color="#009900"><input type=text size=20 name=firstname></font>");
+ out.println("<font color="#009900"><br></font>");
+ out.println("<font color="#009900">Last Name:</font>");
+ out.println("<font color="#009900"><input type=text size=20 name=lastname></font>");
+ out.println("<font color="#009900"><br></font>");
+ out.println("<font color="#009900"><input type=submit></font>");
+ out.println("<font color="#009900"></form></font>");
+ out.println("<font color="#009900"></body></font>");
+ out.println("<font color="#009900"></html></font>");
+ }
+
+ <font color="#0000FF">public void</font> doPost(HttpServletRequest request, HttpServletResponse res)
+ <font color="#0000FF">throws</font> IOException, ServletException
+ {
+ doGet(request, response);
+ }
+}</pre>
+</body>
+</html>
diff --git a/tomcat-uid/webapps/examples/servlets/sessions.html b/tomcat-uid/webapps/examples/servlets/sessions.html
new file mode 100644
index 0000000..65fc7fd
--- /dev/null
+++ b/tomcat-uid/webapps/examples/servlets/sessions.html
@@ -0,0 +1,70 @@
+<!--
+ 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.
+-->
+<html>
+<head>
+<title>Untitled Document</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+
+<body bgcolor="#FFFFFF">
+<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>
+<pre><font color="#0000FF">import</font> java.io.*;
+<font color="#0000FF">import</font> java.util.*;
+<font color="#0000FF">import</font> javax.servlet.*;
+<font color="#0000FF">import</font> javax.servlet.http.*;
+
+<font color="#0000FF">public class</font> SessionExample <font color="#0000FF">extends</font> HttpServlet {
+
+ <font color="#0000FF">public void</font> doGet(HttpServletRequest request, HttpServletResponse response)
+ <font color="#0000FF">throws</font> IOException, ServletException
+ {
+ response.setContentType("<font color="#009900">text/html</font>");
+ PrintWriter out = response.getWriter();
+
+ HttpSession session = request.getSession(true);
+
+ <font color="#CC0000">// print session info</font>
+
+ Date created = new Date(session.getCreationTime());
+ Date accessed = new Date(session.getLastAccessedTime());
+ out.println("<font color="#009900">ID </font>" + session.getId());
+ out.println("<font color="#009900">Created: </font>" + created);
+ out.println("<font color="#009900">Last Accessed: </font>" + accessed);
+
+ <font color="#CC0000">// set session info if needed</font>
+
+ String dataName = request.getParameter("<font color="#009900">dataName</font>");
+ if (dataName != null && dataName.length() > 0) {
+ String dataValue = request.getParameter("<font color="#009900">dataValue</font>");
+ session.setAttribute(dataName, dataValue);
+ }
+
+ // print session contents
+
+ Enumeration e = session.getAttributeNames();
+ while (e.hasMoreElements()) {
+ String name = (String)e.nextElement();
+ String value = session.getAttribute(name).toString();
+ out.println(name + " <font color="#009900">= </font>" + value);
+ }
+ }
+}</pre>
+</body>
+</html>