You are viewing a plain text version of this content. The canonical link for it is here.
Posted to servletapi-dev@jakarta.apache.org by da...@apache.org on 2001/03/17 00:45:40 UTC

cvs commit: jakarta-servletapi-4/src/share/javax/servlet/http HttpSessionAttributeListener.java HttpServletRequest.java HttpSession.java HttpSessionBindingEvent.java HttpSessionAttributesListener.java

dannyc      01/03/16 15:45:40

  Modified:    src/share/javax/servlet Filter.java ServletContext.java
                        ServletContextAttributeEvent.java
               src/share/javax/servlet/http HttpServletRequest.java
                        HttpSession.java HttpSessionBindingEvent.java
  Added:       src/share/javax/servlet ServletContextAttributeListener.java
               src/share/javax/servlet/http
                        HttpSessionAttributeListener.java
  Removed:     src/share/javax/servlet
                        ServletContextAttributesListener.java
               src/share/javax/servlet/http
                        HttpSessionAttributesListener.java
  Log:
  Made the following API changes as per the expert group in anticipation of the upcoming draft of Servlet 2.3. (in the right branch this time :-))
  
    Filter: removed getFilterConfig()
  
    Filter: removed setFilterConfig(), added init() and destroy()
  
    Listeners: renamed attribute Listener interfaces, updated javadoc links from event classes
  
    ServletContext: added extra argument to getResourcePaths()
  
    HttpSession: added new getServletContext() method
  
    HttpServletRequest: fixed typo in CLIENT_CERT_AUTH static value
  
  Revision  Changes    Path
  1.2       +24 -10    jakarta-servletapi-4/src/share/javax/servlet/Filter.java
  
  Index: Filter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-servletapi-4/src/share/javax/servlet/Filter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Filter.java	2001/01/09 03:24:15	1.1
  +++ Filter.java	2001/03/16 23:45:27	1.2
  @@ -89,18 +89,18 @@
   public interface Filter {
   
   	/** 
  -	* The container calls this method when the Filter is instantiated and
  -	** passes in a FilterConfig object. When the container is done with
  -	** the Filter, it calls this method, passing in null.
  +	* Called by the web container to indicate to a filter that it is being placed into
  +	* service. The servlet container calls the init method exactly once after instantiating the
  +	* filter. The init method must complete successfully before the filter is asked to do any
  +	* filtering work. <br><br>
  +
  +     	* The web container cannot place the filter into service if the init method either<br>
  +        * 1.Throws a ServletException <br>
  +        * 2.Does not return within a time period defined by the web container 
   	*/
  -	public void setFilterConfig(FilterConfig filterConfig);
  +	public void init(FilterConfig filterConfig);
   	
  -	/** 
  -	* Return the FilterConfig for this Filter.
  -	* 
  -	*/
  -	public FilterConfig getFilterConfig();
  -
  +	
   	/**
   	* The <code>doFilter</code> method of the Filter is called by the container
   	* each time a request/response pair is passed through the chain due
  @@ -118,6 +118,20 @@
   	** 5. Directly set headers on the response after invokation of the next entity in ther filter chain.
   	**/
       public void doFilter ( ServletRequest request, ServletResponse response, FilterChain chain ) throws IOException, ServletException;
  +
  +	/**
  +	* Called by the web container to indicate to a filter that it is being taken out of service. This 
  +	* method is only called once all threads within the filter's doFilter method have exited or after
  +	* a timeout period has passed. After the web container calls this method, it will not call the
  +	* doFilter method again on this instance of the filter. <br><br>
  +	* 
  +     	* This method gives the filter an opportunity to clean up any resources that are being held (for
  +	* example, memory, file handles, threads) and make sure that any persistent state is synchronized
  +	* with the filter's current state in memory.
  +	*/
  +
  +	public void destroy();
  +
   
   }
   
  
  
  
  1.2       +24 -5     jakarta-servletapi-4/src/share/javax/servlet/ServletContext.java
  
  Index: ServletContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-servletapi-4/src/share/javax/servlet/ServletContext.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServletContext.java	2001/01/09 03:24:16	1.1
  +++ ServletContext.java	2001/03/16 23:45:28	1.2
  @@ -174,14 +174,33 @@
       public String getMimeType(String file);
       
       /**
  -    * Return all the paths to resources held in the web application. All paths are
  -    * java.lang.String objects, begin with a leading /, and are relative to the root
  -    * of the web application.
  -    *@return an immutable set containing the paths
  +    * Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path
  +    * matches the supplied path argument. Paths indicating subdirectory paths end with a '/'. The returned paths are all 
  +    * relative to the root of the web application and have a leading '/'. For example, for a web application 
  +    * containing<br><br>
  +
  +    * /welcome.html<br>
  +    * /catalog/index.html<br>
  +    * /catalog/products.html<br>
  +    * /catalog/offers/books.html<br>
  +    * /catalog/offers/music.html<br>
  +    * /customer/login.jsp<br>
  +    * /WEB-INF/web.xml<br>
  +    * /WEB-INF/classes/com.acme.OrderServlet.class,<br><br>
  +    *
  +    * getResourcePaths("/") returns {"/welcome.html", "/catalog/", "/customer/", "/WEB-INF/"}<br>
  +    * getResourcePaths("/catalog/") returns {"/catalog/index.html", "/catalog/products.html", "/catalog/offers/"}.<br>
  +	   
  +
  +
  +    *@param the partial path used to match the resources, which must start with a /
  +    *@return a Set containing the directory listing, or null if there are no resources in the web application whose path
  +	* begins with the supplied path.
  +
       * @since Servlet 2.3
       */
       
  -    public Set getResourcePaths();
  +    public Set getResourcePaths(String path);
       
       
   
  
  
  
  1.2       +1 -1      jakarta-servletapi-4/src/share/javax/servlet/ServletContextAttributeEvent.java
  
  Index: ServletContextAttributeEvent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-servletapi-4/src/share/javax/servlet/ServletContextAttributeEvent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ServletContextAttributeEvent.java	2001/01/09 03:24:16	1.1
  +++ ServletContextAttributeEvent.java	2001/03/16 23:45:29	1.2
  @@ -64,7 +64,7 @@
   	/** 
   	* This is the event class for notifications about changes to the attributes of the
   	*  servlet context of a web application.
  -	* @see ServletContextAttributesListener
  +	* @see ServletContextAttributeListener
   	 * @since	v 2.3
   	*/
   
  
  
  
  1.1                  jakarta-servletapi-4/src/share/javax/servlet/ServletContextAttributeListener.java
  
  Index: ServletContextAttributeListener.java
  ===================================================================
  package javax.servlet;
  
  import java.util.EventListener;
  
  	/** Implementations of this interface recieve notifications of
  	** changes to the attribute list on the servlet context of a web application. 
  	* To recieve notification events, the implementation class
  	* must be configured in the deployment descriptor for the web application.
  	* @see ServletContextAttributeEvent
  	 * @since	v 2.3
  	*/
  
  public interface ServletContextAttributeListener extends EventListener {
  	/** Notification that a new attribute was added to the servlet context. Called after the attribute is added.*/
  public void attributeAdded(ServletContextAttributeEvent scab);
  	/** Notification that an existing attribute has been remved from the servlet context. Called after the attribute is removed.*/
  public void attributeRemoved(ServletContextAttributeEvent scab);
  	/** Notification that an attribute on the servlet context has been replaced. Called after the attribute is replaced. */
  public void attributeReplaced(ServletContextAttributeEvent scab);
  }
  
  
  
  
  1.2       +2 -2      jakarta-servletapi-4/src/share/javax/servlet/http/HttpServletRequest.java
  
  Index: HttpServletRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-servletapi-4/src/share/javax/servlet/http/HttpServletRequest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HttpServletRequest.java	2001/01/09 03:24:19	1.1
  +++ HttpServletRequest.java	2001/03/16 23:45:35	1.2
  @@ -91,9 +91,9 @@
       */
       public static final String FORM_AUTH = "FORM";
       /**
  -    * String identifier for Basic authentication. Value "CERT-CLIENT"
  +    * String identifier for Basic authentication. Value "CLIENT_CERT"
       */
  -    public static final String CLIENT_CERT_AUTH = "CERT-CLIENT";
  +    public static final String CLIENT_CERT_AUTH = "CLIENT_CERT";
       /**
       * String identifier for Basic authentication. Value "DIGEST"
       */
  
  
  
  1.2       +11 -1     jakarta-servletapi-4/src/share/javax/servlet/http/HttpSession.java
  
  Index: HttpSession.java
  ===================================================================
  RCS file: /home/cvs/jakarta-servletapi-4/src/share/javax/servlet/http/HttpSession.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HttpSession.java	2001/01/09 03:24:19	1.1
  +++ HttpSession.java	2001/03/16 23:45:36	1.2
  @@ -61,6 +61,7 @@
   package javax.servlet.http;
   
   import java.util.Enumeration;
  +import javax.servlet.ServletContext;
   
   /**
    *
  @@ -184,7 +185,16 @@
       public long getLastAccessedTime();
       
       
  -    
  +    /**
  +    * Returns the ServletContext to which this session belongs.
  +    *    
  +    * @return The ServletContext object for the web application
  +    * @since 2.3
  +    */
  +
  +    public ServletContext getServletContext();
  +
  +
       /**
        *
        * Specifies the time, in seconds, between client requests before the 
  
  
  
  1.2       +2 -2      jakarta-servletapi-4/src/share/javax/servlet/http/HttpSessionBindingEvent.java
  
  Index: HttpSessionBindingEvent.java
  ===================================================================
  RCS file: /home/cvs/jakarta-servletapi-4/src/share/javax/servlet/http/HttpSessionBindingEvent.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- HttpSessionBindingEvent.java	2001/01/09 03:24:20	1.1
  +++ HttpSessionBindingEvent.java	2001/03/16 23:45:37	1.2
  @@ -68,7 +68,7 @@
    *
    * Either Sent to an object that implements
    * {@link HttpSessionBindingListener} when it is bound or 
  - * unbound from a session, or to a {@link HttpSessionAttributesListener} 
  + * unbound from a session, or to a {@link HttpSessionAttributeListener} 
    * that has been configured in the deploymewnt descriptor when any attribute is
    * bound, unbound or replaced in a session.
    *
  @@ -83,7 +83,7 @@
    * @since v2.3
    * @see 		HttpSession
    * @see 		HttpSessionBindingListener
  - * @see			HttpSessionAttributesListener
  + * @see			HttpSessionAttributeListener
    */
   
   public class HttpSessionBindingEvent extends HttpSessionEvent {
  
  
  
  1.1                  jakarta-servletapi-4/src/share/javax/servlet/http/HttpSessionAttributeListener.java
  
  Index: HttpSessionAttributeListener.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 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 apache@apache.org.
   *
   * 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/>.
   *
   * ====================================================================
   *
   * This source code implements specifications defined by the Java
   * Community Process. In order to remain compliant with the specification
   * DO NOT add / change / or delete method signatures!
   */
  
  package javax.servlet.http;
  
  import java.util.EventListener;
  
  	/** This listener interface can be implemented in order to
  	* get notifications of changes to the attribute lists of sessions within
  	* this web application.
  	* @since	v 2.3
  */
  
  public interface HttpSessionAttributeListener extends EventListener {
  	/** Notification that an attribute has been added to a session.*/
      public void attributeAdded ( HttpSessionBindingEvent se );
  	/** Notification that an attribute has been removed from a session.*/
      public void attributeRemoved ( HttpSessionBindingEvent se );
  	/** Notification that an attribute has been replaced in a session.*/
      public void attributeReplaced ( HttpSessionBindingEvent se );
  
  }