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

## org.apache.cocoon.servlet.controller
Class ControllerContextHelper

    java.lang.Object
      org.apache.cocoon.servlet.controller.ControllerContextHelper

    public class ControllerContextHelper

extends Object

This class helps with storing and retrieving the controller context. Internally it uses the current servlet request. Thanks to the servlet-service framework, the current request becomes the parent of all sub-requests that use e.g. the 'servlet:' protocol. This means that it is enough to store objects that should be available in a sub-request into the current request.

Constructor Summary
`ControllerContextHelper()`

Method Summary
`static Map<String,Object>` | `getContext(Map<String,? extends Object> parameters)` Retrieve the current controller context from the Cocoon parameters.
`static void` | `storeContext(Map<String,Object> controllerContext, HttpServletRequest request)` Store the controller context (a `Map` directly into the `HttpServletRequest`.
`static void` | `storeContext(Map<String,Object> controllerContext, Map<String,Object> parameters)` Store the controller context (a `Map`) in the Cocoon parameters.

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

Constructor Detail

### ControllerContextHelper

    public ControllerContextHelper()

Method Detail

### getContext

    public static Map<String,Object> getContext(Map<String,? extends Object> parameters)

  Retrieve the current controller context from the Cocoon parameters.

  Parameters:
    `parameters` - The Cocoon parameters map.
  Returns:
    The controller context map as being available in the current servlet request.

### storeContext

    public static void storeContext(Map<String,Object> controllerContext,
                                    Map<String,Object> parameters)

  Store the controller context (a `Map`) in the Cocoon parameters.

  Parameters:
    `controllerContext` - The objects that should be available in the child request.
    `parameters` - The Cocoon parameters map.

### storeContext

    public static void storeContext(Map<String,Object> controllerContext,
                                    HttpServletRequest request)

  Store the controller context (a `Map` directly into the `HttpServletRequest`.

  Parameters:
    `controllerContext` - The objects that should be available in the child request.
    `request` - The current request that becomes the parent of the next request.

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

Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.