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

## org.springframework.mock.web
Class MockServletConfig

    java.lang.Object
      org.springframework.mock.web.MockServletConfig

All Implemented Interfaces:
  javax.servlet.ServletConfig

    public class MockServletConfig

extends java.lang.Object
implements javax.servlet.ServletConfig

Mock implementation of the `ServletConfig` interface.

Used for testing the web framework; typically not necessary for testing application controllers.

Since:
  1.0.2
Author:
  Rod Johnson, Juergen Hoeller

Constructor Summary
`MockServletConfig()` Create a new MockServletConfig with a default `MockServletContext`.
`MockServletConfig(javax.servlet.ServletContext servletContext)` Create a new MockServletConfig.
`MockServletConfig(javax.servlet.ServletContext servletContext, java.lang.String servletName)` Create a new MockServletConfig.
`MockServletConfig(java.lang.String servletName)` Create a new MockServletConfig with a default `MockServletContext`.

Method Summary
`void` | `addInitParameter(java.lang.String name, java.lang.String value)`
`java.lang.String` | `getInitParameter(java.lang.String name)`
`java.util.Enumeration<java.lang.String>` | `getInitParameterNames()`
`javax.servlet.ServletContext` | `getServletContext()`
`java.lang.String` | `getServletName()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MockServletConfig

    public MockServletConfig()

  Create a new MockServletConfig with a default `MockServletContext`.

### MockServletConfig

    public MockServletConfig(java.lang.String servletName)

  Create a new MockServletConfig with a default `MockServletContext`.

  Parameters:
    `servletName` - the name of the servlet

### MockServletConfig

    public MockServletConfig(javax.servlet.ServletContext servletContext)

  Create a new MockServletConfig.

  Parameters:
    `servletContext` - the ServletContext that the servlet runs in

### MockServletConfig

    public MockServletConfig(javax.servlet.ServletContext servletContext,
                             java.lang.String servletName)

  Create a new MockServletConfig.

  Parameters:
    `servletContext` - the ServletContext that the servlet runs in
    `servletName` - the name of the servlet

Method Detail

### getServletName

    public java.lang.String getServletName()

  Specified by:
    `getServletName` in interface `javax.servlet.ServletConfig`

### getServletContext

    public javax.servlet.ServletContext getServletContext()

  Specified by:
    `getServletContext` in interface `javax.servlet.ServletConfig`

### addInitParameter

    public void addInitParameter(java.lang.String name,
                                 java.lang.String value)

### getInitParameter

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

  Specified by:
    `getInitParameter` in interface `javax.servlet.ServletConfig`

### getInitParameterNames

    public java.util.Enumeration<java.lang.String> getInitParameterNames()

  Specified by:
    `getInitParameterNames` in interface `javax.servlet.ServletConfig`

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