Class ExceptionConfig
- All Implemented Interfaces:
Serializable
A JavaBean representing the configuration information of an
<exception> element from a Struts configuration
file.
- Since:
- Struts 1.1
- Version:
- $Rev$ $Date: 2005-08-06 18:03:30 -0400 (Sat, 06 Aug 2005) $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe servlet context attribute under which the message resources bundle to be used for this exception is located.protected booleanHave the inheritance values for this class been applied?protected StringThe fully qualified Java class name of the exception handler class which should be instantiated to handle this exception.protected StringThe type of the ExceptionConfig that this object should inherit properties from.protected StringThe message resources key specifying the error message associated with this exception.protected StringThe module-relative path of the resource to forward to if this exception occurs during anAction.protected StringThe scope in which we should expose the ActionMessage for this exception handler.protected StringThe fully qualified Java class name of the exception that is to be handled by this handler.Fields inherited from class org.apache.struts.config.BaseConfig
configured -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckCircularInheritance(ModuleConfig moduleConfig, ActionConfig actionConfig) Traces the hierarchy of this object to check if any of the ancestors are extending this instance.getKey()getPath()getScope()getType()voidinheritFrom(ExceptionConfig config) Inherit values that have not been overridden from the provided config object.booleanvoidprocessExtends(ModuleConfig moduleConfig, ActionConfig actionConfig) Inherit configuration information from the ExceptionConfig that this instance is extending.voidvoidsetExtends(String inherit) voidsetHandler(String handler) voidvoidvoidvoidtoString()Return a String representation of this object.Methods inherited from class org.apache.struts.config.BaseConfig
copyProperties, freeze, getProperties, getProperty, inheritProperties, setProperties, setProperty, throwIfConfigured
-
Field Details
-
bundle
The servlet context attribute under which the message resources bundle to be used for this exception is located. If not set, the default message resources for the current module is assumed. -
inherit
The type of the ExceptionConfig that this object should inherit properties from. -
extensionProcessed
protected boolean extensionProcessedHave the inheritance values for this class been applied? -
handler
The fully qualified Java class name of the exception handler class which should be instantiated to handle this exception. -
key
The message resources key specifying the error message associated with this exception. -
path
The module-relative path of the resource to forward to if this exception occurs during anAction. -
scope
The scope in which we should expose the ActionMessage for this exception handler. -
type
The fully qualified Java class name of the exception that is to be handled by this handler.
-
-
Constructor Details
-
ExceptionConfig
public ExceptionConfig()
-
-
Method Details
-
getBundle
-
setBundle
-
getExtends
-
setExtends
-
isExtensionProcessed
public boolean isExtensionProcessed() -
getHandler
-
setHandler
-
getKey
-
setKey
-
getPath
-
setPath
-
getScope
-
setScope
-
getType
-
setType
-
checkCircularInheritance
Traces the hierarchy of this object to check if any of the ancestors are extending this instance.
- Parameters:
moduleConfig- TheModuleConfigthat this config is from.actionConfig- TheActionConfigthat this config is from, if applicable. This parameter must be null if this is a global handler.- Returns:
- true if circular inheritance was detected.
-
inheritFrom
public void inheritFrom(ExceptionConfig config) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException Inherit values that have not been overridden from the provided config object. Subclasses overriding this method should verify that the given parameter is of a class that contains a property it is trying to inherit:
if (config instanceof MyCustomConfig) { MyCustomConfig myConfig = (MyCustomConfig) config; if (getMyCustomProp() == null) { setMyCustomProp(myConfig.getMyCustomProp()); } }If the given
configis extending another object, those extensions should be resolved before it's used as a parameter to this method.- Parameters:
config- The object that this instance will be inheriting its values from.- Throws:
ClassNotFoundExceptionIllegalAccessExceptionInstantiationExceptionInvocationTargetException- See Also:
-
processExtends
public void processExtends(ModuleConfig moduleConfig, ActionConfig actionConfig) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException Inherit configuration information from the ExceptionConfig that this instance is extending. This method verifies that any exception config object that it inherits from has also had its processExtends() method called.
- Parameters:
moduleConfig- TheModuleConfigthat this config is from.actionConfig- TheActionConfigthat this config is from, if applicable. This must be null for global forwards.- Throws:
ClassNotFoundExceptionIllegalAccessExceptionInstantiationExceptionInvocationTargetException- See Also:
-
toString
Return a String representation of this object.
-