[Patch][jakarta-tomcat-catalina] ErrorDispatcherValue.java

2002-11-01 Thread Greg Murray
This patch fixes support for changes made between the public draft and 
public final draft for Filter support in Servlet 2.4.

Errors that were generated by a throwable in the ErrorDispatcherValue 
had filters applied properly but those coming from a setStatus (called 
from within a servlet) are not having filters applied as specfied in the 
Servlet specification (See SRV.6.2.5 for details).


This patch fixes compliance with the specification.

The file that needs to be updated is:

/home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves/ErrorDispatcherValve.java 


The changes are minimal for this fix. Let me know if this is a problem

Greg Murray
--- ErrorDispatcherValve.oldFri Nov  1 13:18:46 2002
+++ ErrorDispatcherValve.java   Fri Nov  1 13:14:17 2002
@@ -1,2 +1 @@
-/*
 * $Header: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/valves/ErrorDispatcherValve.java,v
 1.3 2002/09/12 00:09:28 amyroh Exp $
 * $Revision: 1.3 $
 * $Date: 2002/09/12 00:09:28 $
 *
 * 
 *
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in
 *the documentation and/or other materials provided with the
 *distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *any, must include the following acknowlegement:
 *   This product includes software developed by the
 *Apache Software Foundation (http://www.apache.org/).
 *Alternately, this acknowlegement may appear in the software itself,
 *if and wherever such third-party acknowlegements normally appear.
 *
 * 4. The names The Jakarta Project, Tomcat, and Apache Software
 *Foundation must not be used to endorse or promote products derived
 *from this software without prior written permission. For written
 *permission, please contact [EMAIL PROTECTED]
 *
 * 5. Products derived from this software may not be called Apache
 *nor may Apache appear in their names without prior written
 *permission of the Apache Group.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * 
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * http://www.apache.org/.
 *
 * [Additional notices, if required by prior licensing conditions]
 *
 */


package org.apache.catalina.valves;


import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Iterator;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.catalina.Container;
import org.apache.catalina.Context;
import org.apache.catalina.Globals;
import org.apache.catalina.HttpRequest;
import org.apache.catalina.HttpResponse;
import org.apache.catalina.Logger;
import org.apache.catalina.Request;
import org.apache.catalina.Response;
import org.apache.catalina.Valve;
import org.apache.catalina.ValveContext;
import org.apache.catalina.Wrapper;
import org.apache.catalina.deploy.ErrorPage;
import org.apache.catalina.util.RequestUtil;
import org.apache.catalina.util.StringManager;
import org.apache.catalina.core.ApplicationFilterFactory;

/**
 * pImplementation of a Valve that handles the error dispatch (that is, will
 * forward to the appropriate error page if necessary)./p
 *
 * pThis Valve should be attached at 

[PATCH][jakarta-tomcat-catalina/webapps/docs/funcspecs] Documentation Patch (fs-admin-apps.xml)

2002-10-13 Thread IAS

Update to follow JSTL version with explicit implementation.
(Please refer to [Bug 13587] New: - version out of date in some document
http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg35125.html 
for more detail.)

IAS

Indepedent Java Technology Evangelist
http://www.iasandcb.pe.kr

Jakarta Seoul Project Coordinator
http://jakarta.apache-korea.org 



Index: fs-admin-apps.xml
===
RCS file: 
/home/cvspublic/jakarta-tomcat-catalina/webapps/docs/funcspecs/fs-admin-apps.xml,v
retrieving revision 1.2
diff -u -r1.2 fs-admin-apps.xml
--- fs-admin-apps.xml   30 Jul 2002 03:58:29 -  1.2
+++ fs-admin-apps.xml   14 Oct 2002 02:56:25 -
@@ -163,7 +163,7 @@
 (supported natively by Tomcat 5)/li
 lia href=http://www.jcp.org/jsr/detail/152.jsp;JavaServer Pages 2.0/a
 (supported natively by Tomcat 5)/li
-liJavaServer Pages Standard Tag Library 1.0-EA (when available)/li
+liJavaServer Pages Standard Tag Library 1.0 (implemented by 
+Taglibs-Standard)/li
 lia href=http://jakarta.apache.org/struts/;Struts Framework/a
 (Version 1.0) - MVC Framework for Web Applications/li
 listrongTO BE DETERMINED/strong - Application for hosting SOAP



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[Patch] [jakarta-tomcat-catalina] Invocation of Servlet Filters for RequestDispacther includes/forwards

2002-08-21 Thread Greg Murray

Hello,

This is in regarding the addition of support for invoking Servlet 
Filters on RequestDispatcher.forwards and RequestDispatcher.includes as 
specfied in the Servlet 2.4 specification Section SRV.6.2.5.

Basically the patch enables a web application to apply filters using a 
new element under the filter-mapping elment of  the web deployment 
descriptor. Elements include REQUEST, FORWARD, and INCLUDE. Based on the 
dispatcher element(s) specified a application will or will not appy 
filters when processing a request. Please see the specification for 
furter details.

In order for this functionality to be enabled the following filles 
needed modifcation:

  org.apache.catalina.core.ApplicationDispatcher.java
  org.apache.catalina.core.StandardWrapperValue.java
  org.apache.catalina.startup.WebRuleSet.java
  org.apache.catalina.deploy.FilterMap.java

One new file was created:

  org.apache.catalina.core.ApplicationFilterFactory.java

Basically I moved all re-usable code related to creating an 
ApplicationFilterChain object into the ApplicationFilterFactory. This 
design will allow for the caching of ApplicationFilterChains in the future.

Attached are the diff files for the changes I am proposing and also the 
new file ApplicationFilterFactory.java

Pleease let me know what you all think about these changes.

Regards,

Greg Murray







ApplicationDispat29a793eb
Description: application/text


ApplicationFilterc0664a84
Description: application/text

--- FilterMap.java.orig Thu Jul 18 09:48:05 2002
+++ FilterMap.java  Mon Aug 19 11:12:28 2002
@@ -88,7 +88,23 @@
  * The name of this filter to be executed when this mapping matches
  * a particular request.
  */
-private String filterName = null;
+//added by Greg Murray
+
+public static final int FORWARD =1;
+public static final int FORWARD_INCLUDE =2;
+public static final int INCLUDE  =3;
+public static final int REQUEST = 4;
+public static final int REQUEST_FORWARD =5;
+public static final int REQUEST_INCLUDE =6;
+public static final int REQUEST_FORWARD_INCLUDE =7;
+
+// represents nothing having been set. This will be seen 
+// as equal to a REQUEST
+private static final int NOT_SET = -1;
+
+private int dispatcherMapping=NOT_SET;
+
+private String filterName = null;
 
 public String getFilterName() {
 return (this.filterName);
@@ -124,6 +140,59 @@
 
 public void setURLPattern(String urlPattern) {
 this.urlPattern = RequestUtil.URLDecode(urlPattern);
+}
+
+/**
+ * Added by Greg Murray
+ *
+ * This method will be used to set the current state of the FilterMap
+ * representing the state of when filters should be applied:
+ *
+ *FORWARD
+ *FORWARD_INCLUDE
+ *INCLUDE
+ *REQUEST
+ *REQUEST_INCLUDE,
+ *REQUEST_FORWARD,
+ *REQUEST_FORWARD_INCLUDE
+ *
+ */
+public void setDispatcher(String dispatcherString) {
+String dispatcher = dispatcherString.toUpperCase();
+
+if (dispatcher.equals(FORWARD)) {
+
+// apply FORWARD to the global dispatcherMapping.
+switch (dispatcherMapping) {
+case INCLUDE  :  dispatcherMapping = FORWARD_INCLUDE; break;
+case NOT_SET  :  dispatcherMapping = FORWARD; break;
+case REQUEST : dispatcherMapping = REQUEST_FORWARD; break;
+case REQUEST_INCLUDE : dispatcherMapping = REQUEST_FORWARD_INCLUDE; 
+break;
+}
+} else if (dispatcher.equals(INCLUDE)) {
+// apply INCLUDE to the global dispatcherMapping.
+switch (dispatcherMapping) {
+case FORWARD  :  dispatcherMapping = FORWARD_INCLUDE; break;
+case NOT_SET  :  dispatcherMapping = INCLUDE; break;
+case REQUEST : dispatcherMapping = REQUEST_INCLUDE; break;
+case REQUEST_FORWARD : dispatcherMapping = REQUEST_FORWARD_INCLUDE; 
+break;
+}
+} else if (dispatcher.equals(REQUEST)) {
+// apply REQUEST to the global dispatcherMapping.
+switch (dispatcherMapping) {
+case FORWARD  :  dispatcherMapping = REQUEST_FORWARD; break;
+case INCLUDE  :  dispatcherMapping = REQUEST_INCLUDE; break;
+case NOT_SET  :  dispatcherMapping = REQUEST; break;
+case FORWARD_INCLUDE : dispatcherMapping = REQUEST_FORWARD_INCLUDE; 
+break;
+}
+}
+}
+
+public int getDispatcherMapping() {
+// per the SRV.6.2.5 absence of any dispatcher elements is
+// equivelant to a REQUEST value
+if (dispatcherMapping == NOT_SET) return REQUEST;
+else return dispatcherMapping; 
 }
 
 




--- WebRuleSet.java.origFri Aug  9 09:22:36 2002
+++ WebRuleSet.java Tue Aug 13 14:41:22 2002
@@ -258,6 +258,10 @@
 

[PATCH]'jakarta-tomcat-catalina]

2002-08-02 Thread Jean-francois Arcand

Hi,

this patch clean up the code and turn on automatically namespace 
validation when using schema.

Thanks,

-- Jeanfrancois



Index: ContextConfig.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
retrieving revision 1.4
diff -u -r1.4 ContextConfig.java
--- ContextConfig.java  1 Aug 2002 04:53:03 -   1.4
+++ ContextConfig.java  2 Aug 2002 20:01:18 -
@@ -496,10 +496,6 @@
 tldDigester.register(Constants.J2eeSchemaPublicId_14,
  url.toString());
 
-url = ContextConfig.class.getResource(Constants.W3cSchemaResourcePath_10);
-tldDigester.register(Constants.W3cSchemaPublicId_10,
- url.toString());
-
 url = ContextConfig.class.getResource(Constants.JspSchemaResourcePath_20);
 tldDigester.register(Constants.JspSchemaPublicId_20,
  url.toString());
@@ -511,7 +507,11 @@
 url = ContextConfig.class.getResource(Constants.TldSchemaResourcePath_20);
 tldDigester.register(Constants.TldSchemaPublicId_20,
  url.toString());
-
+
+url = ContextConfig.class.getResource(Constants.WebSchemaResourcePath_24);
+tldDigester.register(Constants.WebSchemaPublicId_24,
+ url.toString());
+
 tldDigester.addRuleSet(new TldRuleSet());
 return (tldDigester);
 
@@ -526,6 +526,7 @@
 
 URL url = null;
 Digester webDigester = new Digester();
+webDigester.setNamespaceAware(true);
 webDigester.setValidating(true);
 url = ContextConfig.class.getResource(Constants.WebDtdResourcePath_22);
 webDigester.register(Constants.WebDtdPublicId_22,
@@ -555,10 +556,6 @@
 
 url = ContextConfig.class.getResource(Constants.JspSchemaResourcePath_20);
 webDigester.register(Constants.JspSchemaPublicId_20,
- url.toString());
-
-url = ContextConfig.class.getResource(Constants.W3cSchemaResourcePath_10);
-webDigester.register(Constants.W3cSchemaPublicId_10,
  url.toString());
 
 url = ContextConfig.class.getResource(Constants.TldSchemaResourcePath_20);



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


[PATCH][jakarta-tomcat-catalina]

2002-07-31 Thread Jean-francois Arcand

Hi,

this minor change fixes a bug : when an appllication is undeployed 
(removed), ContainerEvent with the value of REMOVE_EVENT are fired.

The bug is also in jakarta-tomcat-4. Should I send another patch?

Thanks,

-- Jeanfrancois



Index: StandardHostDeployer.java
===
RCS file: 
/home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 StandardHostDeployer.java
--- StandardHostDeployer.java   18 Jul 2002 16:48:05 -  1.1.1.1
+++ StandardHostDeployer.java   1 Aug 2002 00:58:15 -
@@ -418,7 +418,8 @@
 host.log(sm.getString(standardHost.removing, contextPath));
 try {
 host.removeChild(context);
-} catch (Exception e) {
+host.fireContainerEvent(REMOVE_EVENT, context);
+   } catch (Exception e) {
 host.log(sm.getString(standardHost.removeError, contextPath), e);
 throw new IOException(e.toString());
 }



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]