01 /*
02 * Copyright 2004 The Apache Software Foundation
03 *
04 * Licensed under the Apache License, Version 2.0 (the "License");
05 * you may not use this file except in compliance with the License.
06 * You may obtain a copy of the License at
07 *
08 * http://www.apache.org/licenses/LICENSE-2.0
09 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package javax.servlet;
17
18 import java.util.Enumeration;
19
20 /**
21 *
22 * A servlet configuration object used by a servlet container
23 * to pass information to a servlet during initialization.
24 *
25 */
26
27 public interface ServletConfig {
28
29 /**
30 * Returns the name of this servlet instance.
31 * The name may be provided via server administration, assigned in the
32 * web application deployment descriptor, or for an unregistered (and thus
33 * unnamed) servlet instance it will be the servlet's class name.
34 *
35 * @return the name of the servlet instance
36 *
37 *
38 *
39 */
40
41 public String getServletName();
42
43 /**
44 * Returns a reference to the {@link ServletContext} in which the caller
45 * is executing.
46 *
47 *
48 * @return a {@link ServletContext} object, used
49 * by the caller to interact with its servlet
50 * container
51 *
52 * @see ServletContext
53 *
54 */
55
56 public ServletContext getServletContext();
57
58 /**
59 * Returns a <code>String</code> containing the value of the
60 * named initialization parameter, or <code>null</code> if
61 * the parameter does not exist.
62 *
63 * @param name a <code>String</code> specifying the name
64 * of the initialization parameter
65 *
66 * @return a <code>String</code> containing the value
67 * of the initialization parameter
68 *
69 */
70
71 public String getInitParameter(String name);
72
73 /**
74 * Returns the names of the servlet's initialization parameters
75 * as an <code>Enumeration</code> of <code>String</code> objects,
76 * or an empty <code>Enumeration</code> if the servlet has
77 * no initialization parameters.
78 *
79 * @return an <code>Enumeration</code> of <code>String</code>
80 * objects containing the names of the servlet's
81 * initialization parameters
82 *
83 *
84 *
85 */
86
87 public Enumeration getInitParameterNames();
88
89 }
|