You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2006/05/29 13:51:43 UTC

svn commit: r410080 [3/6] - in /tomcat/tc6.0.x/trunk/webapps/examples: ./ WEB-INF/ WEB-INF/classes/ WEB-INF/classes/cal/ WEB-INF/classes/chat/ WEB-INF/classes/checkbox/ WEB-INF/classes/colors/ WEB-INF/classes/compressionFilters/ WEB-INF/classes/dates/ ...

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/listeners/ContextListener.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/listeners/ContextListener.java?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/listeners/ContextListener.java (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/listeners/ContextListener.java Mon May 29 04:51:34 2006
@@ -0,0 +1,155 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT 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
+ * @version $Revision: 267129 $ $Date: 2004-03-18 17:40:35 +0100 (jeu., 18 mars 2004) $
+ */
+
+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);
+
+    }
+
+
+    /**
+     * Log a message and associated exception to the servlet context
+     * application log.
+     *
+     * @param message Message to be logged
+     * @param throwable Exception to be logged
+     */
+    private void log(String message, Throwable throwable) {
+
+	if (context != null)
+	    context.log("ContextListener: " + message, throwable);
+	else {
+	    System.out.println("ContextListener: " + message);
+	    throwable.printStackTrace(System.out);
+	}
+
+    }
+
+
+}

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/listeners/ContextListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/listeners/SessionListener.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/listeners/SessionListener.java?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/listeners/SessionListener.java (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/listeners/SessionListener.java Mon May 29 04:51:34 2006
@@ -0,0 +1,182 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT 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
+ * @version $Revision: 267129 $ $Date: 2004-03-18 17:40:35 +0100 (jeu., 18 mars 2004) $
+ */
+
+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);
+
+    }
+
+
+    /**
+     * Log a message and associated exception to the servlet context
+     * application log.
+     *
+     * @param message Message to be logged
+     * @param throwable Exception to be logged
+     */
+    private void log(String message, Throwable throwable) {
+
+	if (context != null)
+	    context.log("SessionListener: " + message, throwable);
+	else {
+	    System.out.println("SessionListener: " + message);
+	    throwable.printStackTrace(System.out);
+	}
+
+    }
+
+
+}

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/listeners/SessionListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/num/NumberGuessBean.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/num/NumberGuessBean.java?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/num/NumberGuessBean.java (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/num/NumberGuessBean.java Mon May 29 04:51:34 2006
@@ -0,0 +1,78 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT 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;
+  }
+}

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/num/NumberGuessBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/servletToJsp.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/servletToJsp.java?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/servletToJsp.java (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/servletToJsp.java Mon May 29 04:51:34 2006
@@ -0,0 +1,32 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT 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.*;
+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("/jsptoserv/hello.jsp").forward(request, response);
+	} catch (Exception ex) {
+	    ex.printStackTrace ();
+	}
+    }
+}

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/servletToJsp.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/sessions/DummyCart.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/sessions/DummyCart.java?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/sessions/DummyCart.java (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/sessions/DummyCart.java Mon May 29 04:51:34 2006
@@ -0,0 +1,69 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT 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 javax.servlet.http.*;
+import java.util.Vector;
+import java.util.Enumeration;
+
+public class DummyCart {
+    Vector v = new Vector();
+    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(HttpServletRequest request) {
+	// null value for submit - user hit enter instead of clicking on 
+	// "add" or "remove"
+	if (submit == null) 
+	    addItem(item);
+
+	if (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;
+    }
+}

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/sessions/DummyCart.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/util/HTMLFilter.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/util/HTMLFilter.java?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/util/HTMLFilter.java (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/util/HTMLFilter.java Mon May 29 04:51:34 2006
@@ -0,0 +1,68 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT 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
+ * @version $Revision: 267129 $ $Date: 2004-03-18 17:40:35 +0100 (jeu., 18 mars 2004) $
+ */
+
+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("&lt;");
+                break;
+            case '>':
+                result.append("&gt;");
+                break;
+            case '&':
+                result.append("&amp;");
+                break;
+            case '"':
+                result.append("&quot;");
+                break;
+            default:
+                result.append(content[i]);
+            }
+        }
+        return (result.toString());
+
+    }
+
+
+}
+

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/util/HTMLFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/validators/DebugValidator.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/validators/DebugValidator.java?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/validators/DebugValidator.java (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/validators/DebugValidator.java Mon May 29 04:51:34 2006
@@ -0,0 +1,83 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT 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
+ * @version $Revision: 267129 $ $Date: 2004-03-18 17:40:35 +0100 (jeu., 18 mars 2004) $
+ */
+
+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);
+
+    }
+
+
+}

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/classes/validators/DebugValidator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/applet/Clock2.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/applet/Clock2.java?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/applet/Clock2.java (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/applet/Clock2.java Mon May 29 04:51:34 2006
@@ -0,0 +1,211 @@
+/*
+* Copyright 2004 The Apache Software Foundation
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT 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;
+    }
+}

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/applet/Clock2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/debug-taglib.tld
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/debug-taglib.tld?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/debug-taglib.tld (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/debug-taglib.tld Mon May 29 04:51:34 2006
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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://jakarta.apache.org/tomcat/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>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/debug-taglib.tld
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/example-taglib.tld
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/example-taglib.tld?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/example-taglib.tld (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/example-taglib.tld Mon May 29 04:51:34 2006
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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://jakarta.apache.org/tomcat/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>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp/example-taglib.tld
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp2/jsp2-example-taglib.tld
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp2/jsp2-example-taglib.tld?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp2/jsp2-example-taglib.tld (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp2/jsp2-example-taglib.tld Mon May 29 04:51:34 2006
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>
+

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/jsp2/jsp2-example-taglib.tld
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/lib/jstl.jar
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/lib/jstl.jar?rev=410080&view=auto
==============================================================================
Binary file - no diff available.

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/lib/jstl.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/lib/standard.jar
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/lib/standard.jar?rev=410080&view=auto
==============================================================================
Binary file - no diff available.

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/lib/standard.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/displayProducts.tag
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/displayProducts.tag?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/displayProducts.tag (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/displayProducts.tag Mon May 29 04:51:34 2006
@@ -0,0 +1,54 @@
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/helloWorld.tag
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/helloWorld.tag?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/helloWorld.tag (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/helloWorld.tag Mon May 29 04:51:34 2006
@@ -0,0 +1,16 @@
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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!

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/panel.tag
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/panel.tag?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/panel.tag (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/panel.tag Mon May 29 04:51:34 2006
@@ -0,0 +1,28 @@
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/xhtmlbasic.tag
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/xhtmlbasic.tag?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/xhtmlbasic.tag (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/tags/xhtmlbasic.tag Mon May 29 04:51:34 2006
@@ -0,0 +1,20 @@
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>

Added: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/web.xml?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/web.xml (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/web.xml Mon May 29 04:51:34 2006
@@ -0,0 +1,306 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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/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-app_2_4.xsd"
+    version="2.4">
+
+    <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</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>/servlet/HelloWorldExample</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>RequestInfoExample</servlet-name>
+        <url-pattern>/servlet/RequestInfoExample/*</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>RequestHeaderExample</servlet-name>
+        <url-pattern>/servlet/RequestHeaderExample</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>RequestParamExample</servlet-name>
+        <url-pattern>/servlet/RequestParamExample</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>CookieExample</servlet-name>
+        <url-pattern>/servlet/CookieExample</url-pattern>
+    </servlet-mapping>
+    <servlet-mapping>
+        <servlet-name>SessionExample</servlet-name>
+        <url-pattern>/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://jakarta.apache.org/tomcat/debug-taglib
+	    </taglib-uri>
+	    <taglib-location>
+	       /WEB-INF/jsp/debug-taglib.tld
+	    </taglib-location>
+	</taglib>
+
+	<taglib>
+	    <taglib-uri>
+	       http://jakarta.apache.org/tomcat/examples-taglib
+	    </taglib-uri>
+	    <taglib-location>
+	       /WEB-INF/jsp/example-taglib.tld
+	    </taglib-location>
+	</taglib>
+
+	<taglib>
+	    <taglib-uri>
+	       http://jakarta.apache.org/tomcat/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>/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>/jsp2/misc/prelude.jspf</include-prelude>
+	    <include-coda>/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>/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>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/cal1.jsp
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/cal1.jsp?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/cal1.jsp (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/cal1.jsp Mon May 29 04:51:34 2006
@@ -0,0 +1,94 @@
+<HTML>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>
+
+
+
+

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/cal1.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/cal2.jsp
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/cal2.jsp?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/cal2.jsp (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/cal2.jsp Mon May 29 04:51:34 2006
@@ -0,0 +1,44 @@
+<HTML>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>
+

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/cal2.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/calendar.html
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/calendar.html?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/calendar.html (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/calendar.html Mon May 29 04:51:34 2006
@@ -0,0 +1,42 @@
+<html>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/calendar.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/login.html
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/login.html?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/login.html (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/login.html Mon May 29 04:51:34 2006
@@ -0,0 +1,46 @@
+<html>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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 demostartes a way JSP can be 
+used with html tables and forms.</font>
+
+</center>
+</body>
+</html>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/cal/login.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/chat.jsp
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/chat.jsp?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/chat.jsp (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/chat.jsp Mon May 29 04:51:34 2006
@@ -0,0 +1,32 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<!--
+  Copyright 2006 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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">
+
+<!-- Body -->
+<frameset>
+  <frame name="post" src="post.jsp" scrolling="no" title="Post message">
+  <frame name="chat" src="chat" scrolling="yes" title="Chat">
+</frameset>
+
+</body>
+</head>
+</html>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/chat.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/login.jsp
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/login.jsp?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/login.jsp (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/login.jsp Mon May 29 04:51:34 2006
@@ -0,0 +1,30 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<!--
+  Copyright 2006 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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="loginForm">
+<input type="hidden" name="action" value="login"/>
+Nickname: <input type="text" name="nickname"/>
+</form>
+
+</body>
+</head>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/login.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/post.jsp
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/post.jsp?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/post.jsp (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/post.jsp Mon May 29 04:51:34 2006
@@ -0,0 +1,35 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+<!--
+  Copyright 2006 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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"/>
+</form>
+
+<br>
+<br>
+
+<a href="javascript:openWindow('http://127.0.0.1:8080/examples/jsp/chat/chat', 640, 480 ,0 ,0 ,0 ,0 ,0 ,1 ,10 ,10 )">Click to open chat window</a>
+
+</body>
+</html>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/chat/post.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/CheckTest.html
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/CheckTest.html?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/CheckTest.html (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/CheckTest.html Mon May 29 04:51:34 2006
@@ -0,0 +1,55 @@
+<HTML>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/CheckTest.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/check.html
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/check.html?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/check.html (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/check.html Mon May 29 04:51:34 2006
@@ -0,0 +1,37 @@
+<HTML>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/check.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/checkresult.jsp
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/checkresult.jsp?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/checkresult.jsp (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/checkresult.jsp Mon May 29 04:51:34 2006
@@ -0,0 +1,63 @@
+<html>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/checkresult.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/cresult.html
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/cresult.html?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/cresult.html (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/cresult.html Mon May 29 04:51:34 2006
@@ -0,0 +1,33 @@
+<html>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/checkbox/cresult.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/ColorGameBean.html
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/ColorGameBean.html?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/ColorGameBean.html (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/ColorGameBean.html Mon May 29 04:51:34 2006
@@ -0,0 +1,115 @@
+<HTML>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/ColorGameBean.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/clr.html
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/clr.html?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/clr.html (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/clr.html Mon May 29 04:51:34 2006
@@ -0,0 +1,33 @@
+<html>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/clr.html
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/colors.html
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/colors.html?rev=410080&view=auto
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/colors.html (added)
+++ tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/colors.html Mon May 29 04:51:34 2006
@@ -0,0 +1,46 @@
+<html>
+<!--
+  Copyright 2004 The Apache Software Foundation
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT 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>

Propchange: tomcat/tc6.0.x/trunk/webapps/examples/jsp/colors/colors.html
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org