org.directwebremoting.util
Class FakeServletConfig

java.lang.Object
  extended by org.directwebremoting.util.FakeServletConfig
All Implemented Interfaces:
javax.servlet.ServletConfig

public class FakeServletConfig
extends java.lang.Object
implements javax.servlet.ServletConfig

A fake implementation of ServletConfig for cases (Like inside Spring) when you don't have a real one, or when you want to modify the initParameters provided by the real ServletConfig

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
FakeServletConfig(javax.servlet.ServletConfig servletConfig)
          Copy the values from another ServletConfig so we can modify them.
FakeServletConfig(java.lang.String name, javax.servlet.ServletContext servletContext)
           
FakeServletConfig(java.lang.String name, javax.servlet.ServletContext servletContext, java.util.Map<java.lang.String,java.lang.String> initParameters)
           
 
Method Summary
 java.lang.String getInitParameter(java.lang.String paramName)
           
 java.util.Enumeration<java.lang.String> getInitParameterNames()
           
 javax.servlet.ServletContext getServletContext()
           
 java.lang.String getServletName()
           
 void setInitParameter(java.lang.String name, java.lang.String value)
          Modify an init parameter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FakeServletConfig

public FakeServletConfig(java.lang.String name,
                         javax.servlet.ServletContext servletContext)
Parameters:
name - The servlet name
servletContext - The ServletContext

FakeServletConfig

public FakeServletConfig(java.lang.String name,
                         javax.servlet.ServletContext servletContext,
                         java.util.Map<java.lang.String,java.lang.String> initParameters)
Parameters:
name - The servlet name
servletContext - The ServletContext
initParameters - Optional init parameters (can be null)

FakeServletConfig

public FakeServletConfig(javax.servlet.ServletConfig servletConfig)
Copy the values from another ServletConfig so we can modify them.

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

setInitParameter

public void setInitParameter(java.lang.String name,
                             java.lang.String value)
Modify an init parameter


getInitParameter

public java.lang.String getInitParameter(java.lang.String paramName)
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

Copyright 2008