tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@hyperreal.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core Container.java Context.java LocalStrings.properties
Date Wed, 03 Nov 1999 20:02:40 GMT
costin      99/11/03 12:02:39

  Modified:    src/share/org/apache/tomcat/core Tag: TOMCAT_J2EE_10F_102199
                        Container.java Context.java LocalStrings.properties
  Log:
  Fix for "multiple serlvets with same name"
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +25 -7     jakarta-tomcat/src/share/org/apache/tomcat/core/Container.java
  
  Index: Container.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Container.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Container.java	1999/10/28 01:04:18	1.1.2.1
  +++ Container.java	1999/11/03 20:02:32	1.1.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Container.java,v
1.1.2.1 1999/10/28 01:04:18 gonzo Exp $
  - * $Revision: 1.1.2.1 $
  - * $Date: 1999/10/28 01:04:18 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Container.java,v
1.1.2.2 1999/11/03 20:02:32 costin Exp $
  + * $Revision: 1.1.2.2 $
  + * $Date: 1999/11/03 20:02:32 $
    *
    * ====================================================================
    *
  @@ -181,19 +181,35 @@
   	servlets.put(name, wrapper);
       }
   
  -    boolean containsServlet(String name) {
  -        ServletWrapper[] sw = getServlets(name);
  +    /** True if we have a servlet with className.
  +     */
  +    boolean containsServlet(String className) {
  +        ServletWrapper[] sw = getServlets(className);
   
           return (sw != null &&
   	    sw.length > 0);
       }
   
  +    /** Check if we have a servlet with the specified name
  +     */
       boolean containsServletByName(String name) {
   	return (servlets.containsKey(name));
       }
  +
  +    /** Remove all servlets with a specific class name
  +     */
  +    void removeServlet(String className) {
  +        removeServlets(getServlets(className));
  +    }
   
  -    void removeServlet(String name) {
  -        removeServlets(getServlets(name));
  +    /** Remove the servlet with a specific name
  +     */
  +    void removeServletByName(String servletName) {
  +	ServletWrapper wrapper=(ServletWrapper)servlets.get(servletName);
  +	if( wrapper != null ) {
  +	    ServletWrapper wa[]={wrapper};
  +	    removeServlets( wa );
  +	}
       }
   
       boolean containsJSP(String path) {
  @@ -413,6 +429,8 @@
   	}
       }
   
  +    /** Return servlets with a specified class name
  +     */
       private ServletWrapper[] getServlets(String name) {
           Vector servletWrappers = new Vector();
   	Enumeration enum = servlets.keys();
  
  
  
  1.5.2.5   +6 -6      jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java
  
  Index: Context.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java,v
  retrieving revision 1.5.2.4
  retrieving revision 1.5.2.5
  diff -u -r1.5.2.4 -r1.5.2.5
  --- Context.java	1999/11/01 02:42:20	1.5.2.4
  +++ Context.java	1999/11/03 20:02:33	1.5.2.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java,v 1.5.2.4
1999/11/01 02:42:20 gonzo Exp $
  - * $Revision: 1.5.2.4 $
  - * $Date: 1999/11/01 02:42:20 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java,v 1.5.2.5
1999/11/03 20:02:33 costin Exp $
  + * $Revision: 1.5.2.5 $
  + * $Date: 1999/11/03 20:02:33 $
    *
    * ====================================================================
    *
  @@ -759,14 +759,14 @@
   		resourceName =
   		    ((ServletDescriptor)webComponentDescriptor).getClassName();
   
  -		if (container.containsServlet(resourceName)) {
  +		if (container.containsServletByName(name)) {
   		    String msg = sm.getString("context.dd.dropServlet",
  -		        resourceName);
  +		        name + "(" + resourceName + ")" );
   
   		    System.out.println(msg);
   		    
   		    removeResource = true;
  -		    container.removeServlet(resourceName);
  +		    container.removeServletByName(name);
   		}
   
   		container.addServlet(name, resourceName, description);
  
  
  
  1.1.2.1   +2 -2      jakarta-tomcat/src/share/org/apache/tomcat/core/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/LocalStrings.properties,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- LocalStrings.properties	1999/10/09 00:30:13	1.1
  +++ LocalStrings.properties	1999/11/03 20:02:35	1.1.2.1
  @@ -1,4 +1,4 @@
  -# $Id: LocalStrings.properties,v 1.1 1999/10/09 00:30:13 duncan Exp $
  +# $Id: LocalStrings.properties,v 1.1.2.1 1999/11/03 20:02:35 costin Exp $
   #
   
   # Localized strings for package org.apache.tomcat.core
  @@ -24,7 +24,7 @@
   context.props.iae=no class for servlet name: {0}
   context.loadServlet.e=cannot load servlet name: {0}
   
  -context.dd.dropServlet=removing servlet: {0}
  +context.dd.dropServlet=Duplicate servlet name, removing previous servlet declaration: {0}
   context.dd.dropMapping=removing mapping: {0}
   context.dd.ignoreMapping=ignoring mapping: {0}
   
  
  
  

Mime
View raw message