com.cc.framework.adapter.struts
Interface ActionContext

All Superinterfaces:
AjaxRequest, HttpContext, RequestContext
All Known Subinterfaces:
ControlActionContext, FormActionContext
All Known Implementing Classes:
ActionContextWrapper, ConcreteActionContext, ConcreteControlActionContext, ConcreteFormActionContext

public interface ActionContext
extends RequestContext, AjaxRequest

If an action is called, all relevant informations (like the session, request, response object) are passed by a context object which implements this interface.

Since:
1.0
Version:
$Revision: 1.1 $
Author:
Harald Schulz

Method Summary
 void addError(java.lang.String key, java.lang.Throwable t)
          Serves to include an exception in the global error collection.
 void addErrors(org.apache.struts.action.ActionMessages errorList)
          Adds an error collection
 void addGlobalError(java.lang.String key)
          Saves a general error (without reference to an input field) and is used to present error messages upon returning from a sub-dialog within the calling dialog.
 void addGlobalError(java.lang.String key, java.lang.Object p1)
          Saves a general error (without reference to an input field)
 void addGlobalError(java.lang.String key, java.lang.Object p1, java.lang.Object p2)
          Saves a general error (without reference to an input field)
 void addGlobalError(java.lang.String key, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
          Saves a general error (without reference to an input field)
 void addGlobalError(java.lang.String key, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4)
          Saves a general error (without reference to an input field)
 void addGlobalMessage(java.lang.String key)
          Saves a message without reference to a Property.
 void addGlobalMessage(java.lang.String key, java.lang.Object p1)
          Saves a message without reference to a Property.
 void addGlobalMessage(java.lang.String key, java.lang.Object p1, java.lang.Object p2)
          Saves a message without reference to a Property.
 void addGlobalMessage(java.lang.String key, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
          Saves a message without reference to a Property.
 void addGlobalMessage(java.lang.String key, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4)
          Saves a message without reference to a Property.
 void addMessages(org.apache.struts.action.ActionMessages messageList)
          Adds an message collection
 void addPropertyError(java.lang.String property, java.lang.String key)
          Saves an error to a Property in the error collection
 void addPropertyError(java.lang.String property, java.lang.String key, java.lang.Object p1)
          Saves an error to a Property in the error collection
 void addPropertyError(java.lang.String property, java.lang.String key, java.lang.Object p1, java.lang.Object p2)
          Saves an error to a Property in the error collection
 void addPropertyError(java.lang.String property, java.lang.String key, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
          Saves an error to a Property in the error collection
 void addPropertyError(java.lang.String property, java.lang.String key, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4)
          Saves an error to a Property in the error collection
 void addPropertyMessage(java.lang.String property, java.lang.String key)
          Saves a message for a Property in the Message collection
 void addPropertyMessage(java.lang.String property, java.lang.String key, java.lang.Object p1)
          Saves a message for a Property in the Message collection
 void addPropertyMessage(java.lang.String property, java.lang.String key, java.lang.Object p1, java.lang.Object p2)
          Saves a message for a Property in the Message collection
 void addPropertyMessage(java.lang.String property, java.lang.String key, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
          Saves a message for a Property in the Message collection
 void addPropertyMessage(java.lang.String property, java.lang.String key, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3, java.lang.Object p4)
          Saves a message for a Property in the Message collection
 void consumeStrutsMessages()
          This method transfers all existing Struts errors and messages into the frameworks message store.
 org.apache.struts.action.ActionForm form()
          Returns the action form
 void forward(org.apache.struts.action.ActionForward forward)
          Sets the forward
 void forwardByName(java.lang.String forwardName)
          Forwards to the Action specified by the Name
 void forwardByName(java.lang.String forwardName, java.lang.Object p1)
          Forwards to the Action specified by the Name
 void forwardByName(java.lang.String forwardName, java.lang.Object[] params)
          Forwards to the Action specified by the Name
 void forwardByName(java.lang.String forwardName, java.lang.Object p1, java.lang.Object p2)
          Forwards to the Action specified by the Name
 void forwardByName(java.lang.String forwardName, java.lang.Object p1, java.lang.Object p2, java.lang.Object p3)
          Forwards to the Action specified by the Name
 void forwardToAction(java.lang.String actionName)
          Forwards to the specified Action
 void forwardToAction(java.lang.String actionName, boolean redirect)
          Forwards to the specified Action
 void forwardToAction(java.lang.String actionName, java.util.Map params)
          Forwards to the specified Action
 void forwardToAction(java.lang.String actionName, java.util.Map params, boolean redirect)
          Forwards to the specified Action
 void forwardToInput()
          Forwards the Request to the Input, which is specified for the Action in the struts configuration.
 void forwardToResponse()
          The next Forward should be directly directed to the Response
 org.apache.struts.action.ActionMessages getErrors()
          Gets the error collection
 org.apache.struts.action.ActionForward getForward()
          Gets the forward
 org.apache.struts.action.ActionMessages getMessages()
          Returns the message collection
 boolean hasErrors()
          Checks whether there are error messages.
 boolean hasMessages()
          Checks whether there are messages present.
 void invalidDialogContext(java.lang.String messageKey)
          Generates a standardized error message if no DialogContext exists.
 boolean isHandeled()
          If an element (control, action class) has handled the request it can set this flag, so that the request is not processed a second time by an other element.
 org.apache.struts.action.ActionMapping mapping()
          Returns the action mapping object
 void setForm(org.apache.struts.action.ActionForm form)
          Associates a new ActionForm with this ActionContext
 void validateForm()
          Validates the action form and adds the error messages to the internal error collection
 
Methods inherited from interface com.cc.framework.adapter.RequestContext
getLocale, getNestedContext, getPrincipal
 
Methods inherited from interface com.cc.framework.http.HttpContext
getAttribute, getServletContext, request, response, session
 
Methods inherited from interface com.cc.framework.adapter.AjaxRequest
addMenu, cancelAjaxRequest, getAjaxAttribute, getAjaxAttributeNames, getDirtyControls, getMenus, isAjaxCanceled, isAjaxRequest, markDirty, setAjaxAttribute
 

Method Detail

invalidDialogContext

public void invalidDialogContext(java.lang.String messageKey)
Generates a standardized error message if no DialogContext exists.

Parameters:
messageKey - Message Key

mapping

public org.apache.struts.action.ActionMapping mapping()
Returns the action mapping object

Returns:
the action mapping

form

public org.apache.struts.action.ActionForm form()
Returns the action form

Returns:
the action form

setForm

public void setForm(org.apache.struts.action.ActionForm form)
Associates a new ActionForm with this ActionContext

Parameters:
form -
Since:
1.6.038

validateForm

public void validateForm()
Validates the action form and adds the error messages to the internal error collection


isHandeled

public boolean isHandeled()
If an element (control, action class) has handled the request it can set this flag, so that the request is not processed a second time by an other element.

Returns:
boolean

getForward

public org.apache.struts.action.ActionForward getForward()
Gets the forward

Returns:
Returns a ActionForward

forward

public void forward(org.apache.struts.action.ActionForward forward)
Sets the forward

Parameters:
forward - The forward to set

forwardToResponse

public void forwardToResponse()
The next Forward should be directly directed to the Response


forwardToInput

public void forwardToInput()
Forwards the Request to the Input, which is specified for the Action in the struts configuration.


forwardToAction

public void forwardToAction(java.lang.String actionName)
Forwards to the specified Action

Parameters:
actionName - Action name

forwardToAction

public void forwardToAction(java.lang.String actionName,
                            boolean redirect)
Forwards to the specified Action

Parameters:
actionName - Action name
redirect - when set to true a redirect (HTTP 303) will be sent to the browser

forwardToAction

public void forwardToAction(java.lang.String actionName,
                            java.util.Map params)
Forwards to the specified Action

Parameters:
actionName - Action name
params - Additional Parameter map (key - value pairs)

forwardToAction

public void forwardToAction(java.lang.String actionName,
                            java.util.Map params,
                            boolean redirect)
Forwards to the specified Action

Parameters:
actionName - Action name
params - Additional Parameter map (key - value pairs)
redirect - when set to true a redirect (HTTP 303) will be sent to the browser

forwardByName

public void forwardByName(java.lang.String forwardName)
Forwards to the Action specified by the Name

Parameters:
forwardName - Action name

forwardByName

public void forwardByName(java.lang.String forwardName,
                          java.lang.Object p1)
Forwards to the Action specified by the Name

Parameters:
forwardName - Action name
p1 - Additional Parameter

forwardByName

public void forwardByName(java.lang.String forwardName,
                          java.lang.Object p1,
                          java.lang.Object p2)
Forwards to the Action specified by the Name

Parameters:
forwardName - Action name
p1 - Additional Parameter
p2 - Additional Parameter

forwardByName

public void forwardByName(java.lang.String forwardName,
                          java.lang.Object p1,
                          java.lang.Object p2,
                          java.lang.Object p3)
Forwards to the Action specified by the Name

Parameters:
forwardName - Action name
p1 - Additional Parameter
p2 - Additional Parameter
p3 - Additional Parameter

forwardByName

public void forwardByName(java.lang.String forwardName,
                          java.lang.Object[] params)
Forwards to the Action specified by the Name

Parameters:
forwardName - Action name
params - Object array with additional parameter

consumeStrutsMessages

public void consumeStrutsMessages()
This method transfers all existing Struts errors and messages into the frameworks message store. The Struts messages and error collections will be cleared. Otherwise the messages will be duplicated by a forward request.


getErrors

public org.apache.struts.action.ActionMessages getErrors()
Gets the error collection

Returns:
ActionErrors

addErrors

public void addErrors(org.apache.struts.action.ActionMessages errorList)
Adds an error collection

Parameters:
errorList - ActionErrors

addMessages

public void addMessages(org.apache.struts.action.ActionMessages messageList)
Adds an message collection

Parameters:
messageList - ActionMessages

addError

public void addError(java.lang.String key,
                     java.lang.Throwable t)
Serves to include an exception in the global error collection. Remark: The Framework, as against Struts, rescues the error and message text collection across several redirects till the next JSP page is called.

Parameters:
key - Key
t - Throwable

addGlobalError

public void addGlobalError(java.lang.String key)
Saves a general error (without reference to an input field) and is used to present error messages upon returning from a sub-dialog within the calling dialog.

Parameters:
key - Key

addGlobalError

public void addGlobalError(java.lang.String key,
                           java.lang.Object p1)
Saves a general error (without reference to an input field)

Parameters:
key - Key
p1 - Object1

addGlobalError

public void addGlobalError(java.lang.String key,
                           java.lang.Object p1,
                           java.lang.Object p2)
Saves a general error (without reference to an input field)

Parameters:
key - Key
p1 - Object1
p2 - Object2

addGlobalError

public void addGlobalError(java.lang.String key,
                           java.lang.Object p1,
                           java.lang.Object p2,
                           java.lang.Object p3)
Saves a general error (without reference to an input field)

Parameters:
key - Key
p1 - Object1
p2 - Object2
p3 - Object3

addGlobalError

public void addGlobalError(java.lang.String key,
                           java.lang.Object p1,
                           java.lang.Object p2,
                           java.lang.Object p3,
                           java.lang.Object p4)
Saves a general error (without reference to an input field)

Parameters:
key - Key
p1 - Object1
p2 - Object2
p3 - Object3
p4 - Object4

addPropertyError

public void addPropertyError(java.lang.String property,
                             java.lang.String key)
Saves an error to a Property in the error collection

Parameters:
property - The property
key - The key

addPropertyError

public void addPropertyError(java.lang.String property,
                             java.lang.String key,
                             java.lang.Object p1)
Saves an error to a Property in the error collection

Parameters:
property - The property
key - The key
p1 - Additional Parameter

addPropertyError

public void addPropertyError(java.lang.String property,
                             java.lang.String key,
                             java.lang.Object p1,
                             java.lang.Object p2)
Saves an error to a Property in the error collection

Parameters:
property - The property
key - The key
p1 - Additional Parameter
p2 - Additional Parameter

addPropertyError

public void addPropertyError(java.lang.String property,
                             java.lang.String key,
                             java.lang.Object p1,
                             java.lang.Object p2,
                             java.lang.Object p3)
Saves an error to a Property in the error collection

Parameters:
property - The property
key - The key
p1 - Additional Parameter
p2 - Additional Parameter
p3 - Additional Parameter

addPropertyError

public void addPropertyError(java.lang.String property,
                             java.lang.String key,
                             java.lang.Object p1,
                             java.lang.Object p2,
                             java.lang.Object p3,
                             java.lang.Object p4)
Saves an error to a Property in the error collection

Parameters:
property - The property
key - The resource key
p1 - Additional Parameter
p2 - Additional Parameter
p3 - Additional Parameter
p4 - Additional Parameter

hasErrors

public boolean hasErrors()
Checks whether there are error messages.

Returns:
true if there are error messages, false otherwise

getMessages

public org.apache.struts.action.ActionMessages getMessages()
Returns the message collection

Returns:
ActionMessages

addGlobalMessage

public void addGlobalMessage(java.lang.String key)
Saves a message without reference to a Property. Is used to present messages upon returning from a sub-dialog within the calling dialog.

Parameters:
key - Message resource Key

addGlobalMessage

public void addGlobalMessage(java.lang.String key,
                             java.lang.Object p1)
Saves a message without reference to a Property.

Parameters:
key - Message resource Key
p1 - Additional Parameter

addGlobalMessage

public void addGlobalMessage(java.lang.String key,
                             java.lang.Object p1,
                             java.lang.Object p2)
Saves a message without reference to a Property.

Parameters:
key - Message resource Key
p1 - Additional Parameter
p2 - Additional Parameter

addGlobalMessage

public void addGlobalMessage(java.lang.String key,
                             java.lang.Object p1,
                             java.lang.Object p2,
                             java.lang.Object p3)
Saves a message without reference to a Property.

Parameters:
key - Message resource Key
p1 - Additional Parameter
p2 - Additional Parameter
p3 - Additional Parameter

addGlobalMessage

public void addGlobalMessage(java.lang.String key,
                             java.lang.Object p1,
                             java.lang.Object p2,
                             java.lang.Object p3,
                             java.lang.Object p4)
Saves a message without reference to a Property.

Parameters:
key - Message resource Key
p1 - Additional Parameter
p2 - Additional Parameter
p3 - Additional Parameter
p4 - Additional Parameter

addPropertyMessage

public void addPropertyMessage(java.lang.String property,
                               java.lang.String key)
Saves a message for a Property in the Message collection

Parameters:
property - The property
key - Message resource Key

addPropertyMessage

public void addPropertyMessage(java.lang.String property,
                               java.lang.String key,
                               java.lang.Object p1)
Saves a message for a Property in the Message collection

Parameters:
property - The property
key - Message resource Key
p1 - Additional Parameter

addPropertyMessage

public void addPropertyMessage(java.lang.String property,
                               java.lang.String key,
                               java.lang.Object p1,
                               java.lang.Object p2)
Saves a message for a Property in the Message collection

Parameters:
property - The property
key - Message resource Key
p1 - Additional Parameter
p2 - Additional Parameter

addPropertyMessage

public void addPropertyMessage(java.lang.String property,
                               java.lang.String key,
                               java.lang.Object p1,
                               java.lang.Object p2,
                               java.lang.Object p3)
Saves a message for a Property in the Message collection

Parameters:
property - The property
key - Message resource Key
p1 - Additional Parameter
p2 - Additional Parameter
p3 - Additional Parameter

addPropertyMessage

public void addPropertyMessage(java.lang.String property,
                               java.lang.String key,
                               java.lang.Object p1,
                               java.lang.Object p2,
                               java.lang.Object p3,
                               java.lang.Object p4)
Saves a message for a Property in the Message collection

Parameters:
property - The property
key - Message resource Key
p1 - Additional Parameter
p2 - Additional Parameter
p3 - Additional Parameter
p4 - Additional Parameter

hasMessages

public boolean hasMessages()
Checks whether there are messages present.

Returns:
true if there are messages, false otherwise


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.