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

## com.ibm.portal.struts.common
Class ModuleContext

    java.lang.Object
      com.ibm.portal.struts.common.ModuleContext

Direct Known Subclasses:
  ModuleContext

    public class ModuleContext

extends java.lang.Object

The `ModuleContext` class is used for storing and retrieving objects in a context taking into account application prefixes.

Since:
  5.1

Constructor Summary
`ModuleContext(ActionServlet actionServlet, ModuleConfig moduleConfig)` Constructs the ModuleContext object.
`ModuleContext(ServletContext servletContext, java.lang.String modulePrefix)` Constructs the ModuleContext object.

Method Summary
`java.lang.Object` | `getObject(java.lang.String key)` Gets the object stored by key and takes into account the previously saved module prefix.
`java.lang.String` | `getPrefix()` Returns the saved prefix.
`ServletContext` | `getServletContext()` Returns the servlet context.
`void` | `removeObject(java.lang.String key)` Removes the object stored by key and taking into account the previously saved module prefix.
`void` | `setPrefix(java.lang.String prefix)` Sets the prefix to be returned.
`void` | `storeObject(java.lang.String key, java.lang.Object value)` Stores the given object by key and taking into account the previously saved module prefix.

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

Constructor Detail

### ModuleContext

    public ModuleContext(ActionServlet actionServlet,
                         ModuleConfig moduleConfig)

  Constructs the ModuleContext object.

  Parameters:
    `actionServlet` - the action servlet object, can not be `null`
    `moduleConfig` - ModuleConfig object, can not be `null`
  Throws:
    `java.lang.NullPointerException` - if the parameters are `null`

### ModuleContext

    public ModuleContext(ServletContext servletContext,
                         java.lang.String modulePrefix)

  Constructs the ModuleContext object.

  Parameters:
    `servletContext` - the servlet context, can not be `null`
    `modulePrefix` - module prefix, can not be `null`
  Throws:
    `java.lang.NullPointerException` - if the parameters are `null`

Method Detail

### getObject

    public java.lang.Object getObject(java.lang.String key)

  Gets the object stored by key and takes into account the previously saved module prefix.

  Parameters:
    `key` - identifies object (not including application prefix)
  Returns:
    returns the object, value can be `null`

### removeObject

    public void removeObject(java.lang.String key)

  Removes the object stored by key and taking into account the previously saved module prefix.

  Parameters:
    `key` - identifies object

### storeObject

    public void storeObject(java.lang.String key,
                            java.lang.Object value)

  Stores the given object by key and taking into account the previously saved module prefix.

  Parameters:
    `key` - identifies object
    `value` - the value to save

### getPrefix

    public java.lang.String getPrefix()

  Returns the saved prefix.

  Returns:
    returns the prefix

### setPrefix

    public void setPrefix(java.lang.String prefix)

  Sets the prefix to be returned.

  Parameters:
    `prefix` - the prefix

### getServletContext

    public ServletContext getServletContext()

  Returns the servlet context.

  Returns:
    returns the servlet context

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