com.ibm.portal.struts.command
Class StrutsViewErrorCommand

java.lang.Object
  extended by com.ibm.portal.struts.command.StrutsViewCommand
      extended by com.ibm.portal.struts.command.StrutsViewErrorCommand
All Implemented Interfaces:
IViewCommand, java.io.Serializable

public class StrutsViewErrorCommand
extends StrutsViewCommand

The StrutsViewErrorCommand class is specific command pattern class used to display the ErrorResponseInfo object. The typical way to customize how the error command is displayed is to provide a custom error response formatter. The formatters are configured on a per module basis by the Struts plugin mechanism. See the info center and samples for more information on the Error Response Formatter.

Since:
5.1
See Also:
Serialized Form

Field Summary
protected static java.lang.String ERROR_INFO
          name of request attribute for error info object
 
Fields inherited from class com.ibm.portal.struts.command.StrutsViewCommand
CONTENT_TYPE, messages, PREFIX
 
Constructor Summary
StrutsViewErrorCommand(ErrorResponseInfo errorInfo, PortletRequest request)
          Construct our View command
 
Method Summary
static void addAttributeNameToSave(java.lang.String attributeName)
          Add the name of an attribute from the object request the needs to be saved if present for the execution of the IViewCommand in Portal's render phase
static void addAttributeTypeToSave(java.lang.Class attributeType)
          Add the class type of an attribute from request that needs to be saved if present for the execution of the IViewCommand in Portal's render phase
 void execute(RenderRequest request, RenderResponse response, ViewCommandExecutionContext executionContext)
          Execute the given command given the request and response objects
 ErrorResponseInfo getErrorInfo(PortletRequest request)
          Get the error response info object
static void removeAttributeNameToSave(java.lang.String attributeName)
          Remove the name of an attribute from the list of attribute names to save
static void removeAttributeTypeToSave(java.lang.Class attributeType)
          Remove the class type of the request attribute from the list of attributes to save.
 void saveAttributes(PortletRequest request, ViewCommandExecutionContext executionContext)
          Save the attributes specific to ErrorResponseInfo rendering.
 void setErrorInfo(PortletRequest request, ErrorResponseInfo errorInfo)
          Set the error response info object
 
Methods inherited from class com.ibm.portal.struts.command.StrutsViewCommand
addAttribute, getContentType, getPrefix, getRemoveOnModeChange, getSavedAttributes, getSavedCommand, removeAttribute, repopulateRequest, saveAsAttribute, saveAttribute, saveAttributes, saveCommand, saveCommand, setContentType, setContentType, setPrefix, setRemoveOnModeChange, setSavedAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_INFO

protected static final java.lang.String ERROR_INFO
name of request attribute for error info object

See Also:
Constant Field Values
Constructor Detail

StrutsViewErrorCommand

public StrutsViewErrorCommand(ErrorResponseInfo errorInfo,
                              PortletRequest request)
Construct our View command

Parameters:
errorInfo - the ErrorResponseInfo object
request - The request object to save context information from
Method Detail

execute

public void execute(RenderRequest request,
                    RenderResponse response,
                    ViewCommandExecutionContext executionContext)
             throws PortletException
Execute the given command given the request and response objects

Specified by:
execute in interface IViewCommand
Overrides:
execute in class StrutsViewCommand
Parameters:
request - The request object
response - The response object
executionContext - the execution context object
Throws:
PortletException - if the request cannot be fulfilled

saveAttributes

public void saveAttributes(PortletRequest request,
                           ViewCommandExecutionContext executionContext)
Save the attributes specific to ErrorResponseInfo rendering.

Overrides:
saveAttributes in class StrutsViewCommand
Parameters:
request - the request object
executionContext - the context object

setErrorInfo

public void setErrorInfo(PortletRequest request,
                         ErrorResponseInfo errorInfo)
Set the error response info object

Parameters:
request - the portlet request object
errorInfo - the error response info object

getErrorInfo

public ErrorResponseInfo getErrorInfo(PortletRequest request)
Get the error response info object

Parameters:
request - the portlet request object
Returns:
returns the error response info object

addAttributeNameToSave

public static void addAttributeNameToSave(java.lang.String attributeName)
Add the name of an attribute from the object request the needs to be saved if present for the execution of the IViewCommand in Portal's render phase

Parameters:
attributeName - the name of the attribute

removeAttributeNameToSave

public static void removeAttributeNameToSave(java.lang.String attributeName)
Remove the name of an attribute from the list of attribute names to save

Parameters:
attributeName - the name of the attribute

addAttributeTypeToSave

public static void addAttributeTypeToSave(java.lang.Class attributeType)
Add the class type of an attribute from request that needs to be saved if present for the execution of the IViewCommand in Portal's render phase

Parameters:
attributeType - the attribute type

removeAttributeTypeToSave

public static void removeAttributeTypeToSave(java.lang.Class attributeType)
Remove the class type of the request attribute from the list of attributes to save.

Parameters:
attributeType - the attribute type