File tomcat-8.0.53-CVE-2024-54677.patch of Package tomcat.37363

Index: apache-tomcat-8.0.53-src/java/org/apache/tomcat/util/json/JSONFilter.java
===================================================================
--- /dev/null
+++ apache-tomcat-8.0.53-src/java/org/apache/tomcat/util/json/JSONFilter.java
@@ -0,0 +1,140 @@
+/*
+ * 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 org.apache.tomcat.util.json;
+
+/**
+ * Provides escaping of values so they can be included in a JSON document.
+ * Escaping is based on the definition of JSON found in
+ * <a href="https://www.rfc-editor.org/rfc/rfc8259.html">RFC 8259</a>.
+ */
+public class JSONFilter {
+
+    /**
+     * Escape the given char.
+     * @param c the char
+     * @return a char array with the escaped sequence
+     */
+    public static char[] escape(char c) {
+        if (c < 0x20 || c == 0x22 || c == 0x5c || Character.isHighSurrogate(c) || Character.isLowSurrogate(c)) {
+            char popular = getPopularChar(c);
+            if (popular > 0) {
+                return new char[] { '\\', popular };
+            } else {
+                StringBuilder escaped = new StringBuilder(6);
+                escaped.append("\\u");
+                escaped.append(String.format("%04X", Integer.valueOf(c)));
+                return escaped.toString().toCharArray();
+            }
+        } else {
+            char[] result = new char[1];
+            result[0] = c;
+            return result;
+        }
+    }
+
+    /**
+     * Escape the given string.
+     * @param input the string
+     * @return the escaped string
+     */
+    public static String escape(String input) {
+        return escape(input, 0, input.length()).toString();
+    }
+
+    /**
+     * Escape the given char sequence.
+     * @param input the char sequence
+     * @return the escaped char sequence
+     */
+    public static CharSequence escape(CharSequence input) {
+        return escape(input, 0, input.length());
+    }
+
+    /**
+     * Escape the given char sequence.
+     * @param input the char sequence
+     * @param off the offset on which escaping will start
+     * @param length the length which should be escaped
+     * @return the escaped char sequence corresponding to the specified range
+     */
+    public static CharSequence escape(CharSequence input, int off, int length) {
+        /*
+         * While any character MAY be escaped, only U+0000 to U+001F (control
+         * characters), U+0022 (quotation mark) and U+005C (reverse solidus)
+         * MUST be escaped.
+         */
+        StringBuilder escaped = null;
+        int lastUnescapedStart = off;
+        for (int i = off; i < length; i++) {
+            char c = input.charAt(i);
+            if (c < 0x20 || c == 0x22 || c == 0x5c || Character.isHighSurrogate(c) || Character.isLowSurrogate(c)) {
+                if (escaped == null) {
+                    escaped = new StringBuilder(length + 20);
+                }
+                if (lastUnescapedStart < i) {
+                    escaped.append(input.subSequence(lastUnescapedStart, i));
+                }
+                lastUnescapedStart = i + 1;
+                char popular = getPopularChar(c);
+                if (popular > 0) {
+                    escaped.append('\\').append(popular);
+                } else {
+                    escaped.append("\\u");
+                    escaped.append(String.format("%04X", Integer.valueOf(c)));
+                }
+            }
+        }
+        if (escaped == null) {
+            if (off == 0 && length == input.length()) {
+                return input;
+            } else {
+                return input.subSequence(off, length - off);
+            }
+        } else {
+            if (lastUnescapedStart < length) {
+                escaped.append(input.subSequence(lastUnescapedStart, length));
+            }
+            return escaped.toString();
+        }
+    }
+
+    private JSONFilter() {
+        // Utility class. Hide the default constructor.
+    }
+
+    private static char getPopularChar(char c) {
+        switch (c) {
+            case '"':
+            case '\\':
+            case '/':
+                return c;
+            case 0x8:
+                return 'b';
+            case 0xc:
+                return 'f';
+            case 0xa:
+                return 'n';
+            case 0xd:
+                return 'r';
+            case 0x9:
+                return 't';
+            default:
+                return 0;
+        }
+    }
+
+}
Index: apache-tomcat-8.0.53-src/webapps/docs/changelog.xml
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/docs/changelog.xml
+++ apache-tomcat-8.0.53-src/webapps/docs/changelog.xml
@@ -247,6 +247,30 @@
         Enable host name verification when using TLS with the WebSocket client.
         (markt)
       </fix>
+      <fix>
+        Examples. Expand the obfuscation of session cookie values in the request
+        header example to JSON responses. (markt)
+      </fix>
+      <add>
+        Examples. Add the ability to delete session attributes in the servlet
+        session example. (markt)
+      </add>
+      <add>
+        Examples. Add a hard coded limit of 10 attributes per session for the
+        servlet session example. (markt)
+      </add>
+      <add>
+        Examples. Add the ability to delete session attributes and add a hard
+        coded limit of 10 attributes per session for the JSP form authentication
+        example. (markt)
+      </add>
+      <add>
+        Examples. Limit the shopping cart example to only allow adding the
+        pre-defined items to the cart. (markt)
+      </add>
+      <fix>
+        Examples. Remove JSP calendar example. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web applications">
Index: apache-tomcat-8.0.53-src/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
+++ apache-tomcat-8.0.53-src/webapps/examples/WEB-INF/classes/RequestHeaderExample.java
@@ -1,20 +1,19 @@
 /*
-* 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.
-*/
-
+ * 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.IOException;
 import java.io.PrintWriter;
 import java.util.Enumeration;
@@ -27,6 +26,8 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
+import org.apache.tomcat.util.json.JSONFilter;
+
 import util.CookieFilter;
 import util.HTMLFilter;
 
@@ -40,13 +41,48 @@ public class RequestHeaderExample extend
 
     private static final long serialVersionUID = 1L;
 
-    private static final ResourceBundle RB = ResourceBundle.getBundle("LocalStrings");
-
     @Override
-    public void doGet(HttpServletRequest request,
-                      HttpServletResponse response)
-        throws IOException, ServletException
-    {
+    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
+        if (prefersJSON(request.getHeader("Accept"))) {
+            renderJSON(request, response);
+        } else {
+            renderHTML(request, response);
+        }
+    }
+
+    /**
+     * Returns true if the client appears to prefer a JSON response, false otherwise. Note that this method is not very
+     * pedantic and uses only a very lazy algorithm for checking whether JSON is "preferred".
+     *
+     * @param acceptHeader The value of the HTTP "Accept" header from the client.
+     *
+     * @return true if the client appears to prefer a JSON response, false otherwise.
+     */
+    protected boolean prefersJSON(String acceptHeader) {
+        if (null == acceptHeader) {
+            return false;
+        }
+        // mime/type, mime/type;q=n, ...
+
+        // Don't bother with the q-factor.
+        // This is not expected to be 100% accurate or spec-compliant
+        String[] accepts = acceptHeader.split(",");
+        for (String accept : accepts) {
+            if (accept.contains("application/json")) {
+                return true;
+            }
+
+            // text/html, application/html, etc.
+            if (accept.contains("html")) {
+                return false;
+            }
+        }
+        return false;
+    }
+
+    protected void renderHTML(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        ResourceBundle rb = ResourceBundle.getBundle("LocalStrings", request.getLocale());
+
         response.setContentType("text/html");
         response.setCharacterEncoding("UTF-8");
 
@@ -55,7 +91,7 @@ public class RequestHeaderExample extend
         out.println("<head>");
         out.println("<meta charset=\"UTF-8\" />");
 
-        String title = RB.getString("requestheader.title");
+        String title = rb.getString("requestheader.title");
         out.println("<title>" + title + "</title>");
         out.println("</head>");
         out.println("<body bgcolor=\"white\">");
@@ -97,11 +133,35 @@ public class RequestHeaderExample extend
         out.println("</table>");
     }
 
+    protected void renderJSON(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        response.setContentType("application/json");
+        response.setCharacterEncoding("UTF-8");
+
+        PrintWriter out = response.getWriter();
+
+        out.append('[');
+        Enumeration<String> e = request.getHeaderNames();
+        while (e.hasMoreElements()) {
+            String headerName = e.nextElement();
+            String headerValue = request.getHeader(headerName);
+
+            out.append("{\"")
+            .append(JSONFilter.escape(headerName))
+            .append("\":\"")
+            .append(JSONFilter.escape(headerValue))
+            .append("\"}")
+            ;
+
+            if (e.hasMoreElements()) {
+                out.append(',');
+            }
+        }
+
+        out.print("]");
+    }
+
     @Override
-    public void doPost(HttpServletRequest request,
-                      HttpServletResponse response)
-        throws IOException, ServletException
-    {
+    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
         doGet(request, response);
     }
 
Index: apache-tomcat-8.0.53-src/build.xml
===================================================================
--- apache-tomcat-8.0.53-src.orig/build.xml
+++ apache-tomcat-8.0.53-src/build.xml
@@ -1161,15 +1161,6 @@
       </fileset>
     </txt2html>
 
-    <txt2html todir="${tomcat.build}/webapps/examples/jsp/cal">
-      <fileset dir="webapps/examples/WEB-INF/classes/cal">
-        <include name="Entries.java"/>
-        <include name="Entry.java"/>
-        <include name="JspCalendar.java"/>
-        <include name="TableBean.java"/>
-      </fileset>
-    </txt2html>
-
     <txt2html todir="${tomcat.build}/webapps/examples/jsp/jsptoserv">
       <fileset dir="webapps/examples/WEB-INF/classes">
         <include name="ServletToJsp.java"/>
Index: apache-tomcat-8.0.53-src/webapps/examples/WEB-INF/classes/SessionExample.java
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/WEB-INF/classes/SessionExample.java
+++ apache-tomcat-8.0.53-src/webapps/examples/WEB-INF/classes/SessionExample.java
@@ -17,6 +17,7 @@
 
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.net.URLEncoder;
 import java.util.Date;
 import java.util.Enumeration;
 import java.util.ResourceBundle;
@@ -39,13 +40,13 @@ public class SessionExample extends Http
 
     private static final long serialVersionUID = 1L;
 
-    private static final ResourceBundle RB = ResourceBundle.getBundle("LocalStrings");
+    private static final int SESSION_ATTRIBUTE_COUNT_LIMIT = 10;
+
 
     @Override
-    public void doGet(HttpServletRequest request,
-                      HttpServletResponse response)
-        throws IOException, ServletException
-    {
+    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
+        ResourceBundle rb = ResourceBundle.getBundle("LocalStrings", request.getLocale());
+
         response.setContentType("text/html");
         response.setCharacterEncoding("UTF-8");
 
@@ -55,7 +56,7 @@ public class SessionExample extends Http
         out.println("<meta charset=\"UTF-8\" />");
 
 
-        String title = RB.getString("sessions.title");
+        String title = rb.getString("sessions.title");
         out.println("<title>" + title + "</title>");
         out.println("</head>");
         out.println("<body bgcolor=\"white\">");
@@ -77,70 +78,94 @@ public class SessionExample extends Http
         out.println("<h3>" + title + "</h3>");
 
         HttpSession session = request.getSession(true);
-        out.println(RB.getString("sessions.id") + " " + session.getId());
+        out.println(rb.getString("sessions.id") + " " + session.getId());
         out.println("<br>");
-        out.println(RB.getString("sessions.created") + " ");
+        out.println(rb.getString("sessions.created") + " ");
         out.println(new Date(session.getCreationTime()) + "<br>");
-        out.println(RB.getString("sessions.lastaccessed") + " ");
+        out.println(rb.getString("sessions.lastaccessed") + " ");
         out.println(new Date(session.getLastAccessedTime()));
 
+        // Count the existing attributes
+        int sessionAttributeCount = 0;
+        Enumeration<String> names = session.getAttributeNames();
+        while (names.hasMoreElements()) {
+            names.nextElement();
+            sessionAttributeCount++;
+        }
+
         String dataName = request.getParameter("dataname");
         String dataValue = request.getParameter("datavalue");
-        if (dataName != null && dataValue != null) {
+        if (dataName != null) {
+            if (dataValue == null) {
+                session.removeAttribute(dataName);
+                sessionAttributeCount--;
+            } else if (sessionAttributeCount < SESSION_ATTRIBUTE_COUNT_LIMIT) {
             session.setAttribute(dataName, dataValue);
+                sessionAttributeCount++;
+            } else {
+                out.print("<p> Session attribute [");
+                out.print(HTMLFilter.filter(dataName));
+                out.print("] not added as there are already "+ SESSION_ATTRIBUTE_COUNT_LIMIT + " attributes in the ");
+                out.println("session. Delete an attribute before adding another.");
+            }
         }
 
-        out.println("<P>");
-        out.println(RB.getString("sessions.data") + "<br>");
-        Enumeration<String> names = session.getAttributeNames();
+        out.println("<p>");
+        out.println(rb.getString("sessions.data") + "<br>");
+        names = session.getAttributeNames();
         while (names.hasMoreElements()) {
             String name = names.nextElement();
             String value = session.getAttribute(name).toString();
-            out.println(HTMLFilter.filter(name) + " = "
-                        + HTMLFilter.filter(value) + "<br>");
+            out.println(HTMLFilter.filter(name) + " = " + HTMLFilter.filter(value));
+            out.print("<a href=\"");
+            out.print(HTMLFilter.filter(
+                    response.encodeURL("SessionExample?dataname=" + URLEncoder.encode(name, "UTF-8"))));
+            out.println("\" >delete</a>");
+            out.println("<br>");
         }
 
-        out.println("<P>");
+        if (sessionAttributeCount < SESSION_ATTRIBUTE_COUNT_LIMIT) {
+            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(rb.getString("sessions.dataname"));
         out.println("<input type=text size=20 name=dataname>");
         out.println("<br>");
-        out.println(RB.getString("sessions.datavalue"));
+        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.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(rb.getString("sessions.dataname"));
         out.println("<input type=text size=20 name=dataname>");
         out.println("<br>");
-        out.println(RB.getString("sessions.datavalue"));
+        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.print(HTMLFilter.filter(response.encodeURL("SessionExample?dataname=exampleName&datavalue=exampleValue")));
         out.println("\" >URL encoded </a>");
+        } else {
+            out.print("<p>You may not add more than " + SESSION_ATTRIBUTE_COUNT_LIMIT + " attributes to this session.");
+        }
 
         out.println("</body>");
         out.println("</html>");
     }
 
     @Override
-    public void doPost(HttpServletRequest request,
-                      HttpServletResponse response)
-        throws IOException, ServletException
-    {
+    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
         doGet(request, response);
     }
 
 
Index: apache-tomcat-8.0.53-src/webapps/examples/WEB-INF/classes/sessions/DummyCart.java
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/WEB-INF/classes/sessions/DummyCart.java
+++ apache-tomcat-8.0.53-src/webapps/examples/WEB-INF/classes/sessions/DummyCart.java
@@ -1,57 +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.
-*/
+ * 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;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
 
 public class DummyCart {
-    final Vector<String> v = new Vector<>();
+    final Set<Item> items = Collections.synchronizedSet(new HashSet<Item>());
+    int itemId = -1;
     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 setItemId(int itemId) {
+        this.itemId = itemId;
     }
 
     public void setSubmit(String s) {
         submit = s;
     }
 
-    public String[] getItems() {
-        String[] s = new String[v.size()];
-        v.copyInto(s);
-        return s;
+    private void addItem(int itemId) {
+        try {
+            items.add(Item.values()[itemId]);
+        } catch (ArrayIndexOutOfBoundsException e) {
+            // Ignore. Can only happen if user edits URL directly.
+        }
+    }
+
+    private void removeItem(int itemId) {
+        try {
+            items.remove(Item.values()[itemId]);
+        } catch (ArrayIndexOutOfBoundsException e) {
+            // Ignore. Can only happen if user edits URL directly.
+        }
+    }
+
+    public Item[] getItems() {
+        return items.toArray(new Item[0]);
     }
 
     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);
+        if (submit == null || submit.equals("add")) {
+            addItem(itemId);
+        } else if (submit.equals("remove")) {
+            removeItem(itemId);
+        }
 
         // reset at the end of the request
         reset();
@@ -60,6 +69,6 @@ public class DummyCart {
     // reset
     private void reset() {
         submit = null;
-        item = null;
+        itemId = -1;
     }
-}
+}
\ No newline at end of file
Index: apache-tomcat-8.0.53-src/webapps/examples/WEB-INF/classes/sessions/Item.java
===================================================================
--- /dev/null
+++ apache-tomcat-8.0.53-src/webapps/examples/WEB-INF/classes/sessions/Item.java
@@ -0,0 +1,37 @@
+/*
+ * 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;
+
+public enum Item {
+
+    VIDEO("Beavis & Butt-head Video collection"),
+    MOVIE("X-files movie"),
+    TAPES("Twin peaks tapes"),
+    CD("NIN CD"),
+    BOOK("JSP Book"),
+    TICKETS("Concert tickets");
+
+    private final String title;
+
+    Item(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+}
Index: apache-tomcat-8.0.53-src/webapps/examples/jsp/cal/cal2.jsp
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/jsp/cal/cal2.jsp
+++ /dev/null
@@ -1,45 +0,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.
---%>
-<%@page contentType="text/html; charset=UTF-8" %>
-<HTML>
-<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>
-
Index: apache-tomcat-8.0.53-src/webapps/examples/jsp/cal/calendar.html
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/jsp/cal/calendar.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<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>
Index: apache-tomcat-8.0.53-src/webapps/examples/jsp/index.html
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/jsp/index.html
+++ apache-tomcat-8.0.53-src/webapps/examples/jsp/index.html
@@ -229,7 +229,7 @@ This can be done using browser options.<
 <tr>
 <td>Carts</td>
 
-<td style="width: 30%;"><a href="sessions/carts.html"><img src="images/execute.gif" alt=""></a><a href="sessions/carts.html">Execute</a></td>
+<td style="width: 30%;"><a href="sessions/shopping.jsp"><img src="images/execute.gif" alt=""></a><a href="sessions/shopping.jsp">Execute</a></td>
 
 <td style="width: 30%;"><a href="sessions/crt.html"><img src="images/code.gif" alt=""></a><a href="sessions/crt.html">Source</a></td>
 </tr>
@@ -251,14 +251,6 @@ This can be done using browser options.<
 </tr>
 
 <tr>
-<td>Calendar</td>
-
-<td style="width: 30%;"><a href="cal/login.html"><img src="images/execute.gif" alt=""></a><a href="cal/login.html">Execute</a></td>
-
-<td style="width: 30%;"><a href="cal/calendar.html"><img src="images/code.gif" alt=""></a><a href="cal/calendar.html">Source</a></td>
-</tr>
-
-<tr>
 <td>Include</td>
 
 <td style="width: 30%;"><a href="include/include.jsp"><img src="images/execute.gif" alt=""></a><a href="include/include.jsp">Execute</a></td>
Index: apache-tomcat-8.0.53-src/webapps/examples/jsp/security/protected/index.jsp
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/jsp/security/protected/index.jsp
+++ apache-tomcat-8.0.53-src/webapps/examples/jsp/security/protected/index.jsp
@@ -5,15 +5,17 @@
   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 import="java.net.URLEncoder" %>
+<%@ page import="java.security.Principal" %>
+<%@ page import="java.util.Enumeration" %>
+<%@ page import="org.apache.catalina.TomcatPrincipal" %>
 <%
   if (request.getParameter("logoff") != null) {
     session.invalidate();
@@ -72,6 +74,112 @@ enter it here:
 </form>
 <br><br>
 
+<%
+  Principal p = request.getUserPrincipal();
+  if (!(p instanceof TomcatPrincipal)) {
+%>
+<p>The principal does not support attributes.</p>
+<%
+  } else {
+    TomcatPrincipal principal = (TomcatPrincipal) p;
+%>
+<p>The principal contains the following attributes:</p>
+<table>
+<tr><th>Name</th><th>Value</th><th>Type</th></tr>
+<%
+    Enumeration<String> names = principal.getAttributeNames();
+    while (names.hasMoreElements()) {
+      String name = names.nextElement();
+      Object value = principal.getAttribute(name);
+      String type = value != null ? value.getClass().getName() : "unknown";
+      if (value instanceof Object[]) {
+        Object[] values = (Object[]) value;
+        value = "";
+        for (int i = 0; i < values.length; i++) {
+          value += values[i] + "<br/>";
+        }
+        if (values.length > 0) {
+          type = values[0].getClass().getName() + "[]";
+        } else {
+          type = "unknown";
+        }
+      }
+      type = type.replaceFirst("^java\\.lang\\.", "");
+%>
+<tr>
+  <td><%= util.HTMLFilter.filter(name) %></td>
+  <td><%= util.HTMLFilter.filter(String.valueOf(value)) %></td>
+  <td><%= util.HTMLFilter.filter(type) %></td>
+</tr>
+<%
+    }
+%>
+</table>
+<%
+  }
+%>
+<br><br>
+
+<%
+  // Count the existing attributes
+  int sessionAttributeCount = 0;
+  Enumeration<String> names = session.getAttributeNames();
+  while (names.hasMoreElements()) {
+    names.nextElement();
+    sessionAttributeCount++;
+  }
+  String dataName = request.getParameter("dataName");
+  String dataValue = request.getParameter("dataValue");
+  if (dataName != null) {
+    if (dataValue == null) {
+      session.removeAttribute(dataName);
+      sessionAttributeCount--;
+    } else if (sessionAttributeCount < 10) {
+      session.setAttribute(dataName, dataValue);
+      sessionAttributeCount++;
+    } else {
+%>
+<p>Session attribute [<%= util.HTMLFilter.filter(dataName) %>] not added as there are already 10 attributes in the
+session. Delete an attribute before adding another.</p>
+<%
+    }
+  }
+  if (sessionAttributeCount < 10) {
+%>
+To add some data to the authenticated session, enter it here:
+<form method="GET" action='<%= response.encodeURL("index.jsp") %>'>
+<input type="text" name="dataName">
+<input type="text" name="dataValue">
+<input type="submit" >
+</form>
+<%
+  } else {
+%>
+<p>You may not add more than 10 attributes to this session.</p>
+<%
+  }
+%>
+<br><br>
+<p>The authenticated session contains the following attributes:</p>
+<table>
+<tr><th>Name</th><th>Value</th></tr>
+<%
+  names = session.getAttributeNames();
+  while (names.hasMoreElements()) {
+    String name = names.nextElement();
+    String value = session.getAttribute(name).toString();
+%>
+<tr>
+  <td><%= util.HTMLFilter.filter(name) %></td>
+  <td><%= util.HTMLFilter.filter(value) %></td>
+  <td><a href='<%= response.encodeURL("index.jsp?dataName=" + URLEncoder.encode(name, "UTF-8")) %>'>delete</a></td>
+</tr>
+<%
+  }
+%>
+</table>
+<br><br>
+
 If you have configured this application for form-based authentication, you can
 log off by clicking
 <a href='<%= response.encodeURL("index.jsp?logoff=true") %>'>here</a>.
Index: apache-tomcat-8.0.53-src/webapps/examples/jsp/sessions/carts.html
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/jsp/sessions/carts.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<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>
Index: apache-tomcat-8.0.53-src/webapps/examples/jsp/sessions/carts.jsp
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/jsp/sessions/carts.jsp
+++ apache-tomcat-8.0.53-src/webapps/examples/jsp/sessions/carts.jsp
@@ -28,9 +28,9 @@
 <ol>
 <%
     String[] items = cart.getItems();
-    for (int i=0; i<items.length; i++) {
+    for (String item : items) {
 %>
-<li> <% out.print(util.HTMLFilter.filter(items[i])); %>
+<li> <% out.print(util.HTMLFilter.filter(item)); %>
 <%
     }
 %>
@@ -39,5 +39,5 @@
 </FONT>
 
 <hr>
-<%@ include file ="carts.html" %>
+<%@ include file ="shopping.jsp" %>
 </html>
Index: apache-tomcat-8.0.53-src/webapps/examples/jsp/sessions/crt.html
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/jsp/sessions/crt.html
+++ apache-tomcat-8.0.53-src/webapps/examples/jsp/sessions/crt.html
@@ -22,9 +22,12 @@
 </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>
+<p><font color="#0000FF"><a href="shopping.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="carts.jsp.html">Source Code for Cart Example<font color="#0000FF"></a>
+<h3><a href="shopping.jsp.html">Source Code for Cart Example Shopping Page<font color="#0000FF"></a>
+  </font> </h3>
+
+<h3><a href="carts.jsp.html">Source Code for Cart Example Cart Page<font color="#0000FF"></a>
   </font> </h3>
 
 <h3><a href="DummyCart.html">Property Sheet for DummyCart
Index: apache-tomcat-8.0.53-src/webapps/examples/WEB-INF/classes/cal/Entries.java
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/WEB-INF/classes/cal/Entries.java
+++ /dev/null
@@ -1,60 +0,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.
- */
-package cal;
-
-import java.util.Hashtable;
-
-import javax.servlet.http.HttpServletRequest;
-
-public class Entries {
-
-    private final Hashtable<String, Entry> 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 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");
-            entries.get(time[index]).setDescription(descr);
-        }
-    }
-
-}
Index: apache-tomcat-8.0.53-src/webapps/examples/WEB-INF/classes/cal/Entry.java
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/WEB-INF/classes/cal/Entry.java
+++ /dev/null
@@ -1,53 +0,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.
- */
-
-package cal;
-
-public class Entry {
-
-    final String hour;
-    String description;
-
-    public Entry(String hour) {
-        this.hour = hour;
-        this.description = "";
-
-    }
-
-    public String getHour() {
-        return this.hour;
-    }
-
-    public String getColor() {
-        if (description.equals("")) {
-            return "lightblue";
-        }
-        return "red";
-    }
-
-    public String getDescription() {
-        if (description.equals("")) {
-            return "None";
-        }
-        return this.description;
-    }
-
-    public void setDescription(String descr) {
-        description = descr;
-    }
-
-}
Index: apache-tomcat-8.0.53-src/webapps/examples/WEB-INF/classes/cal/JspCalendar.java
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/WEB-INF/classes/cal/JspCalendar.java
+++ /dev/null
@@ -1,151 +0,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.
-*/
-
-package cal;
-
-import java.util.Calendar;
-import java.util.Date;
-
-public class JspCalendar {
-    final Calendar  calendar;
-
-    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);
-    }
-}
-
-
Index: apache-tomcat-8.0.53-src/webapps/examples/WEB-INF/classes/cal/TableBean.java
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/WEB-INF/classes/cal/TableBean.java
+++ /dev/null
@@ -1,101 +0,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.
- */
-package cal;
-
-import java.util.Hashtable;
-
-import javax.servlet.http.HttpServletRequest;
-
-public class TableBean {
-
-    final Hashtable<String, Entries> table;
-    final 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 = 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;
-    }
-}
Index: apache-tomcat-8.0.53-src/webapps/examples/jsp/cal/cal1.jsp
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/jsp/cal/cal1.jsp
+++ /dev/null
@@ -1,94 +0,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.
---%>
-<%@page contentType="text/html; charset=UTF-8" %>
-<HTML>
-<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>
-
-
Index: apache-tomcat-8.0.53-src/webapps/examples/jsp/cal/login.html
===================================================================
--- apache-tomcat-8.0.53-src.orig/webapps/examples/jsp/cal/login.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<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>
openSUSE Build Service is sponsored by