Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.servlet
Interface ServletConfig

All Known Implementing Classes:
  GenericServlet

public interface ServletConfig

ServletConfig encapsulates servlet configuration and gives access to the application (servlet context) object. Servlet initialization parameters appear in the servlet configuration file. Each servlet class may have several different servlet instances, one for each servlet parameters:

     <servlet servlet-name='my1'
              servlet-class='test.MyServlet'>
       <init-param param1='my1-1'/>
       <init-param param2='my1-2'/>
     </servlet>

     <servlet servlet-name='my2'
              servlet-class='test.MyServlet'>
       <init-param param1='my2-1'/>
       <init-param param2='my2-2'/>
     </servlet>

Method Summary
`java.lang.String` | `getInitParameter(java.lang.String name)` Returns an initialization parameter.
`java.util.Enumeration` | `getInitParameterNames()` Enumerates all the initialization parameter.
`ServletContext` | `getServletContext()` Returns the application (servlet context) that the servlet belongs to.
`java.lang.String` | `getServletName()` Returns the servlet name for this configuration.

Method Detail

### getServletName

    public java.lang.String getServletName()

  Returns the servlet name for this configuration. For example, 'myservlet' in the following configuration:

       <servlet servlet-name='myservlet'
                servlet-class='test.MyServlet'/>

### getInitParameter

    public java.lang.String getInitParameter(java.lang.String name)

  Returns an initialization parameter. Initialization parameters are defined in the servlet configuration (in resin.conf) as follows:

       <servlet servlet-name='myservlet'
                servlet-class='test.MyServlet'>
         <init-param param1='value1'/>
         <init-param param2='value2'/>
       </servlet>

  Parameters:
    `name` - of the parameter
  Returns:
    the init parameter value

### getInitParameterNames

    public java.util.Enumeration getInitParameterNames()

  Enumerates all the initialization parameter.

### getServletContext

    public ServletContext getServletContext()

  Returns the application (servlet context) that the servlet belongs to. The application provides several useful methods, e.g. including other files, forwarding, and translating physical paths.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD