tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From craig...@locus.apache.org
Subject cvs commit: jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/session LocalStrings.properties StandardManager.java
Date Sat, 29 Apr 2000 18:24:30 GMT
craigmcc    00/04/29 11:24:29

  Modified:    proposals/catalina/src/conf web.xml
               proposals/catalina/src/share/org/apache/tomcat/core
                        StandardWrapper.java StandardWrapperValve.java
               proposals/catalina/src/share/org/apache/tomcat/resources
                        StandardResources.java
               proposals/catalina/src/share/org/apache/tomcat/servlets
                        DefaultServlet.java
               proposals/catalina/src/share/org/apache/tomcat/session
                        LocalStrings.properties StandardManager.java
  Log:
  Add 'welcome file' support to the default servlet (FIXME - not jsp pages
  yet).  Still messes up on the If-Modified-Since check, no filename part at
  all in the URL, and a few other goodies.
  
  Revision  Changes    Path
  1.2       +5 -2      jakarta-tomcat/proposals/catalina/src/conf/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/conf/web.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- web.xml	2000/04/29 05:59:52	1.1
  +++ web.xml	2000/04/29 18:24:24	1.2
  @@ -6,11 +6,13 @@
   
   <web-app>
   
  -  <!-- The default servlet that normally serves static resources -->
  +  <!-- Mappings in this file are the defaults for all contexts -->
  +
  +  <!-- The default servlet that serves static resources -->
     <servlet>
       <servlet-name>default</servlet-name>
       <servlet-class>org.apache.tomcat.servlets.DefaultServlet</servlet-class>
  -    <load-on-startup>-2147483646</load-on-startup>
  +    <load-on-startup>1</load-on-startup>
       <init-param>
         <param-name>debug</param-name>
         <param-value>99</param-value>
  @@ -50,6 +52,7 @@
     </servlet-mapping>
   
     <!-- The mapping for the invoker servlet -->
  +  <!-- Comment this out if you do not want "invoker" service -->
     <servlet-mapping>
       <servlet-name>invoker</servlet-name>
       <url-pattern>/servlet/*</url-pattern>
  
  
  
  1.7       +21 -4     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapper.java
  
  Index: StandardWrapper.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapper.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StandardWrapper.java	2000/04/29 05:59:54	1.6
  +++ StandardWrapper.java	2000/04/29 18:24:25	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapper.java,v
1.6 2000/04/29 05:59:54 craigmcc Exp $
  - * $Revision: 1.6 $
  - * $Date: 2000/04/29 05:59:54 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapper.java,v
1.7 2000/04/29 18:24:25 craigmcc Exp $
  + * $Revision: 1.7 $
  + * $Date: 2000/04/29 18:24:25 $
    *
    * ====================================================================
    *
  @@ -96,7 +96,7 @@
    * make them efficient are counter-productive.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.6 $ $Date: 2000/04/29 05:59:54 $
  + * @version $Revision: 1.7 $ $Date: 2000/04/29 18:24:25 $
    */
   
   public final class StandardWrapper
  @@ -274,6 +274,23 @@
   
       }
   
  +
  +
  +    /**
  +     * This should not be necessary, but XmlMapper does not seem to find
  +     * the version of setLoadOnStartup with an "int" argument.
  +     *
  +     * @param value New load-on-startup value
  +     */
  +    public void setLoadOnStartup(String value) {
  +
  +	try {
  +	    setLoadOnStartup(Integer.parseInt(value));
  +	} catch (NumberFormatException e) {
  +	    setLoadOnStartup(0);
  +	}
  +
  +    }
   
   
       /**
  
  
  
  1.5       +5 -5      jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapperValve.java
  
  Index: StandardWrapperValve.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapperValve.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StandardWrapperValve.java	2000/04/29 05:59:54	1.4
  +++ StandardWrapperValve.java	2000/04/29 18:24:25	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapperValve.java,v
1.4 2000/04/29 05:59:54 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/04/29 05:59:54 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/core/StandardWrapperValve.java,v
1.5 2000/04/29 18:24:25 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/04/29 18:24:25 $
    *
    * ====================================================================
    *
  @@ -87,7 +87,7 @@
    * <code>StandardWrapper</code> container implementation.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.4 $ $Date: 2000/04/29 05:59:54 $
  + * @version $Revision: 1.5 $ $Date: 2000/04/29 18:24:25 $
    */
   
   final class StandardWrapperValve
  @@ -137,7 +137,7 @@
   	    }
   	    wrapper.deallocate(servlet);
   	} catch (Throwable t) {
  -	    log(sm.getString("servletWrapper.servletException"), t);
  +	    log(sm.getString("standardWrapper.servletException"), t);
   	    wrapper.deallocate(servlet);
   	}
   
  
  
  
  1.4       +5 -5      jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/resources/StandardResources.java
  
  Index: StandardResources.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/resources/StandardResources.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- StandardResources.java	2000/04/29 05:59:55	1.3
  +++ StandardResources.java	2000/04/29 18:24:26	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/resources/StandardResources.java,v
1.3 2000/04/29 05:59:55 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/04/29 05:59:55 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/resources/StandardResources.java,v
1.4 2000/04/29 18:24:26 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/04/29 18:24:26 $
    *
    * ====================================================================
    *
  @@ -66,8 +66,8 @@
   
   
   import java.beans.PropertyChangeEvent;
  -import java.beans.PropertyChangeSupport;
   import java.beans.PropertyChangeListener;
  +import java.beans.PropertyChangeSupport;
   import java.io.File;
   import java.io.FileInputStream;
   import java.io.InputStream;
  @@ -101,7 +101,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/04/29 05:59:55 $
  + * @version $Revision: 1.4 $ $Date: 2000/04/29 18:24:26 $
    */
   
   public final class StandardResources
  
  
  
  1.2       +15 -5     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/servlets/DefaultServlet.java
  
  Index: DefaultServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/servlets/DefaultServlet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultServlet.java	2000/04/29 05:59:56	1.1
  +++ DefaultServlet.java	2000/04/29 18:24:27	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/servlets/DefaultServlet.java,v
1.1 2000/04/29 05:59:56 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/04/29 05:59:56 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/servlets/DefaultServlet.java,v
1.2 2000/04/29 18:24:27 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/04/29 18:24:27 $
    *
    * ====================================================================
    *
  @@ -91,7 +91,7 @@
    * used to serve static resources such as HTML pages and images.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2000/04/29 05:59:56 $
  + * @version $Revision: 1.2 $ $Date: 2000/04/29 18:24:27 $
    */
   
   public final class DefaultServlet
  @@ -380,7 +380,17 @@
   	if (!content)
   	    return;
   
  -	// FIXME - look for a welcome file
  +	// Serve a welcome file if one exists
  +	// FIXME - update the welcome files list?
  +	for (int i = 0; i < welcomes.size(); i++) {
  +	    File file = new File(directory, (String) welcomes.elementAt(i));
  +	    if (file.exists() && file.canRead() && file.isFile()) {
  +		serveFile(requestURI, file.getAbsolutePath(),
  +			  response, content);
  +		return;
  +	    }
  +	}
  +	
   
   	// FIXME - do the directory thing
   	response.setContentType("text/html");
  
  
  
  1.4       +1 -0      jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/session/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/session/LocalStrings.properties,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LocalStrings.properties	2000/04/27 05:55:18	1.3
  +++ LocalStrings.properties	2000/04/29 18:24:28	1.4
  @@ -7,6 +7,7 @@
   standardManager.createSession.ise=createSession: Too many active sessions
   standardManager.loading=Loading persisted sessions from {0}
   standardManager.notStarted=Manager has not yet been started
  +standardManager.sessionTimeout=Invalid session timeout setting {0}
   standardManager.unloading=Saving persisted sessions to {0}
   standardSession.invalidate.ise=invalidate: Session already invalidated
   standardSession.isNew.ise=isNew: Session already invalidated
  
  
  
  1.9       +63 -5     jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/session/StandardManager.java
  
  Index: StandardManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/session/StandardManager.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- StandardManager.java	2000/04/27 05:55:19	1.8
  +++ StandardManager.java	2000/04/29 18:24:28	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/session/StandardManager.java,v
1.8 2000/04/27 05:55:19 craigmcc Exp $
  - * $Revision: 1.8 $
  - * $Date: 2000/04/27 05:55:19 $
  + * $Header: /home/cvs/jakarta-tomcat/proposals/catalina/src/share/org/apache/tomcat/session/StandardManager.java,v
1.9 2000/04/29 18:24:28 craigmcc Exp $
  + * $Revision: 1.9 $
  + * $Date: 2000/04/29 18:24:28 $
    *
    * ====================================================================
    *
  @@ -64,6 +64,10 @@
   
   package org.apache.tomcat.session;
   
  +import java.beans.PropertyChangeEvent;
  +import java.beans.PropertyChangeListener;
  +import java.beans.PropertyChangeSupport;
  +import java.beans.PropertyChangeListener;
   import java.io.BufferedInputStream;
   import java.io.BufferedOutputStream;
   import java.io.FileInputStream;
  @@ -75,6 +79,8 @@
   import java.util.Enumeration;
   import java.util.Hashtable;
   import java.util.Vector;
  +import org.apache.tomcat.Container;
  +import org.apache.tomcat.Context;
   import org.apache.tomcat.Lifecycle;
   import org.apache.tomcat.LifecycleEvent;
   import org.apache.tomcat.LifecycleException;
  @@ -98,12 +104,12 @@
    * <code>stop()</code> methods of this class at the correct times.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.8 $ $Date: 2000/04/27 05:55:19 $
  + * @version $Revision: 1.9 $ $Date: 2000/04/29 18:24:28 $
    */
   
   public final class StandardManager
       extends ManagerBase
  -    implements Lifecycle, Runnable {
  +    implements Lifecycle, PropertyChangeListener, Runnable {
   
   
       // ----------------------------------------------------- Instance Variables
  @@ -208,6 +214,29 @@
   
   
       /**
  +     * Set the Container with which this Manager has been associated.  If
  +     * it is a Context (the usual case), listen for changes to the session
  +     * timeout property.
  +     *
  +     * @param container The associated Container
  +     */
  +    public void setContainer(Container container) {
  +
  +	// De-register from the old Container (if any)
  +	if ((this.container != null) && (this.container instanceof Context))
  +	    ((Context) this.container).removePropertyChangeListener(this);
  +
  +	// Default processing provided by our superclass
  +	super.setContainer(container);
  +
  +	// Register with the new Container (if any)
  +	if ((this.container != null) && (this.container instanceof Context))
  +	    ((Context) this.container).addPropertyChangeListener(this);
  +
  +    }
  +
  +
  +    /**
        * Return the debugging detail level for this component.
        */
       public int getDebug() {
  @@ -405,6 +434,35 @@
   	    if (!session.isValid())
   		continue;
   	    session.expire();
  +	}
  +
  +    }
  +
  +
  +    // ----------------------------------------- PropertyChangeListener Methods
  +
  +
  +    /**
  +     * Process property change events from our associated Context.
  +     *
  +     * @param event The property change event that has occurred
  +     */
  +    public void propertyChange(PropertyChangeEvent event) {
  +
  +	// Validate the source of this event
  +	if (!(event.getSource() instanceof Context))
  +	    return;
  +	Context context = (Context) event.getSource();
  +
  +	// Process a relevant property change
  +	if (event.getPropertyName().equals("sessionTimeout")) {
  +	    try {
  +		setMaxInactiveInterval
  +		    (Integer.parseInt((String) event.getNewValue()));
  +	    } catch (NumberFormatException e) {
  +		log(sm.getString("standardManager.sessionTimeout",
  +				 event.getNewValue().toString()));
  +	    }
   	}
   
       }
  
  
  

Mime
View raw message