home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 September / PCWorld_2000-09_cd.bin / Komunik / sambar / _setup.1 / javaeng.jar / javax / servlet / ServletConfig.java < prev    next >
Text File  |  2000-04-03  |  2KB  |  87 lines

  1. /*
  2.  * ServletConfig.java -- Interface for classes holding initialization data
  3.  *                       to be passed from server to servlet
  4.  *
  5.  * Copyright (c) 1998, 1999 by Free Software Foundation, Inc.
  6.  * Written by Paul Siegmann (pauls@euronet.nl)
  7.  *
  8.  * This program is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU Library General Public License as published
  10.  * by the Free Software Foundation, version 2. (see COPYING.LIB)
  11.  *
  12.  * This program is distributed in the hope that it will be useful, but
  13.  * WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with this program; if not, write to the Free Software Foundation
  19.  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307 USA
  20.  */
  21.  
  22. package javax.servlet;
  23.  
  24. import java.util.Enumeration;
  25.  
  26.  
  27. /**
  28.  * Whenever a server wants to pass initialization data to a servlet, it
  29.  * creates a class which implements this interface.<BR>
  30.  * The server then adds {String,String} pairs to the class, and the servlet
  31.  * can read these using this interface.
  32.  *
  33. #ifdef SERVLET_2_0
  34.  * @version Servlet API 2.0 
  35. #endif
  36. #ifdef SERVLET_2_1
  37.  * @version Servlet API 2.1
  38. #endif
  39. #ifdef SERVLET_2_2
  40.  * @version Servlet API 2.2
  41. #endif
  42.  * @since Servlet API 1.0
  43.  * @author Paul Siegmann (pauls@euronet.nl)
  44.  */
  45. public interface ServletConfig
  46. {
  47.     /**
  48.      * Get the value of this name's initparameter 
  49.      *
  50.      * @since Servlet API 1.0
  51.      *
  52.      * @param name the name of the Parameter whose value we want
  53.      * @return The value of this name's initparameter or null if it doesn't
  54.      * exist
  55.      */
  56.     String getInitParameter (String name);
  57.  
  58.  
  59.     /**
  60.      * Get all InitParameterNames
  61.      *
  62.      * @since Servlet API 1.0
  63.      *
  64.      * @return An enumeration consisting of all the init parameter names
  65.      * or an empty empty enumeration when there are no init parameters
  66.      */
  67.     Enumeration getInitParameterNames ();
  68.  
  69.  
  70.     /**
  71.      * Get the context of this ServletConfig
  72.      *
  73.      * @since Servlet API 1.0
  74.      *
  75.      * @return The context of the servlet whose Config this is
  76.      */
  77.     ServletContext getServletContext ();
  78.  
  79. #ifdef SERVLET_2_2
  80.  
  81.     /**
  82.      * XXX
  83.      */
  84.     String getServletName();
  85. #endif
  86. }
  87.