2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 package javax.servlet;
19 import java.util.Enumeration;
22 * A servlet configuration object used by a servlet container to pass
23 * information to a servlet during initialization.
25 public interface ServletConfig {
28 * Returns the name of this servlet instance. The name may be provided via
29 * server administration, assigned in the web application deployment
30 * descriptor, or for an unregistered (and thus unnamed) servlet instance it
31 * will be the servlet's class name.
33 * @return the name of the servlet instance
35 public String getServletName();
38 * Returns a reference to the {@link ServletContext} in which the caller is
41 * @return a {@link ServletContext} object, used by the caller to interact
42 * with its servlet container
45 public ServletContext getServletContext();
48 * Returns a <code>String</code> containing the value of the named
49 * initialization parameter, or <code>null</code> if the parameter does not
53 * a <code>String</code> specifying the name of the
54 * initialization parameter
55 * @return a <code>String</code> containing the value of the initialization
58 public String getInitParameter(String name);
61 * Returns the names of the servlet's initialization parameters as an
62 * <code>Enumeration</code> of <code>String</code> objects, or an empty
63 * <code>Enumeration</code> if the servlet has no initialization parameters.
65 * @return an <code>Enumeration</code> of <code>String</code> objects
66 * containing the names of the servlet's initialization parameters
68 public Enumeration<String> getInitParameterNames();