|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.config.BaseConfig org.apache.struts.config.ActionConfig
public class ActionConfig
A JavaBean representing the configuration information of an
<action>
element from a Struts module configuration
file.
Field Summary | |
---|---|
protected java.lang.String |
actionId
The internal identification of this action mapping. |
protected java.lang.String |
attribute
The request-scope or session-scope attribute name under which our form bean is accessed, if it is different from the form bean's specified name . |
protected boolean |
cancellable
Can this Action be cancelled? [false] |
protected java.lang.String |
catalog
The name of a commons-chain catalog in which
command should be sought. |
protected java.lang.String |
command
The name of a commons-chain command which should be
executed as part of the processing of this action. |
protected java.util.HashMap |
exceptions
The set of exception handling configurations for this action, if any, keyed by the type property. |
protected boolean |
extensionProcessed
Have the inheritance values for this class been applied? |
protected java.lang.String |
forward
Context-relative path of the web application resource that will process this request via RequestDispatcher.forward(), instead of instantiating and calling the Action class specified by
"type". |
protected java.util.HashMap |
forwards
The set of local forward configurations for this action, if any, keyed by the name property. |
protected java.lang.String |
include
Context-relative path of the web application resource that will process this request via RequestDispatcher.include(), instead of instantiating and calling the Action class specified by
"type". |
protected java.lang.String |
inherit
The path of the ActionConfig that this object should inherit properties from. |
protected java.lang.String |
input
Context-relative path of the input form to which control should be returned if a validation error is encountered. |
protected ModuleConfig |
moduleConfig
The module configuration with which we are associated. |
protected java.lang.String |
multipartClass
Fully qualified Java class name of the MultipartRequestHandler
implementation class used to process multi-part request data for this
Action. |
protected java.lang.String |
name
Name of the form bean, if any, associated with this Action. |
protected java.lang.String |
parameter
General purpose configuration parameter that can be used to pass extra information to the Action instance selected by this Action. |
protected java.lang.String |
path
Context-relative path of the submitted request, starting with a slash ("/") character, and omitting any filename extension if extension mapping is being used. |
protected java.lang.String |
prefix
Prefix used to match request parameter names to form bean property names, if any. |
protected java.lang.String[] |
roleNames
The set of security role names used to authorize access to this Action, as an array for faster access. |
protected java.lang.String |
roles
Comma-delimited list of security role names allowed to request this Action. |
protected java.lang.String |
scope
Identifier of the scope ("request" or "session") within which our form bean is accessed, if any. |
protected java.lang.String |
suffix
Suffix used to match request parameter names to form bean property names, if any. |
protected java.lang.String |
type
Fully qualified Java class name of the Action class to
be used to process requests for this mapping if the
forward and include properties are not set. |
protected boolean |
unknown
Indicates Action be configured as the default one for this module, when true. |
protected boolean |
validate
Should the validate() method of the form bean
associated with this action be called? |
Fields inherited from class org.apache.struts.config.BaseConfig |
---|
configured |
Constructor Summary | |
---|---|
ActionConfig()
|
Method Summary | |
---|---|
void |
addExceptionConfig(ExceptionConfig config)
Add a new ExceptionConfig instance to the set
associated with this action. |
void |
addForwardConfig(ForwardConfig config)
Add a new ForwardConfig instance to the set of global
forwards associated with this action. |
protected boolean |
checkCircularInheritance(ModuleConfig moduleConfig)
Traces the hierarchy of this object to check if any of the ancestors is extending this instance. |
ExceptionConfig |
findException(java.lang.Class type)
Find and return the ExceptionConfig instance defining
how Exceptions of the specified type should be handled. |
ExceptionConfig |
findExceptionConfig(java.lang.String type)
Return the exception configuration for the specified type, if any; otherwise return null . |
ExceptionConfig[] |
findExceptionConfigs()
Return the exception configurations for this action. |
ForwardConfig |
findForwardConfig(java.lang.String name)
Return the forward configuration for the specified key, if any; otherwise return null . |
ForwardConfig[] |
findForwardConfigs()
Return all forward configurations for this module. |
void |
freeze()
Freeze the configuration of this action. |
java.lang.String |
getActionId()
The internal name of this action mapping. |
java.lang.String |
getAttribute()
Returns the request-scope or session-scope attribute name under which our form bean is accessed, if it is different from the form bean's specified name . |
boolean |
getCancellable()
Accessor for cancellable property |
java.lang.String |
getCatalog()
Get the name of a commons-chain catalog in which a
specified command should be sought. |
java.lang.String |
getCommand()
Get the name of a commons-chain command which should
be executed as part of the processing of this action. |
java.lang.String |
getExtends()
Returns the path of the ActionConfig that this object should inherit properties from. |
java.lang.String |
getForward()
Returns context-relative path of the web application resource that will process this request. |
java.lang.String |
getInclude()
Context-relative path of the web application resource that will process this request. |
java.lang.String |
getInput()
Get the context-relative path of the input form to which control should be returned if a validation error is encountered. |
ModuleConfig |
getModuleConfig()
The module configuration with which we are associated. |
java.lang.String |
getMultipartClass()
Return the fully qualified Java class name of the MultipartRequestHandler implementation class used to
process multi-part request data for this Action. |
java.lang.String |
getName()
Return name of the form bean, if any, associated with this Action. |
java.lang.String |
getParameter()
Return general purpose configuration parameter that can be used to pass extra information to the Action instance selected by this Action. |
java.lang.String |
getPath()
Return context-relative path of the submitted request, starting with a slash ("/") character, and omitting any filename extension if extension mapping is being used. |
java.lang.String |
getPrefix()
Retruns prefix used to match request parameter names to form bean property names, if any. |
java.lang.String[] |
getRoleNames()
Get array of security role names used to authorize access to this Action. |
java.lang.String |
getRoles()
|
java.lang.String |
getScope()
Get the scope ("request" or "session") within which our form bean is accessed, if any. |
java.lang.String |
getSuffix()
Return suffix used to match request parameter names to form bean property names, if any. |
java.lang.String |
getType()
|
boolean |
getUnknown()
Determine whether Action is configured as the default one for this module. |
boolean |
getValidate()
|
protected void |
inheritExceptionHandlers(ActionConfig baseConfig)
Compare the exception handlers of this action with that of the given and copy those that are not present. |
protected void |
inheritForwards(ActionConfig baseConfig)
Compare the forwards of this action with that of the given and copy those that are not present. |
void |
inheritFrom(ActionConfig config)
Inherit values that have not been overridden from the provided config object. |
boolean |
isExtensionProcessed()
|
void |
processExtends(ModuleConfig moduleConfig)
Inherit configuration information from the ActionConfig that this instance is extending. |
void |
removeExceptionConfig(ExceptionConfig config)
Remove the specified exception configuration instance. |
void |
removeForwardConfig(ForwardConfig config)
Remove the specified forward configuration instance. |
void |
setActionId(java.lang.String actionId)
The internal name of this action mapping. |
void |
setAttribute(java.lang.String attribute)
Set the request-scope or session-scope attribute name under which our form bean is accessed, if it is different from the form bean's specified name . |
void |
setCancellable(boolean cancellable)
Mutator for for cancellable property |
void |
setCatalog(java.lang.String catalog)
Set the name of a commons-chain catalog in which a
specified command should be sought. |
void |
setCommand(java.lang.String command)
Set the name of a commons-chain command which should
be executed as part of the processing of this action. |
void |
setExtends(java.lang.String inherit)
Set the path of the ActionConfig that this object should inherit properties from. |
void |
setForward(java.lang.String forward)
Set the context-relative path of the web application resource that will process this request. |
void |
setInclude(java.lang.String include)
Set context-relative path of the web application resource that will process this request. |
void |
setInput(java.lang.String input)
Set the context-relative path of the input form to which control should be returned if a validation error is encountered. |
void |
setModuleConfig(ModuleConfig moduleConfig)
The module configuration with which we are associated. |
void |
setMultipartClass(java.lang.String multipartClass)
Set the fully qualified Java class name of the MultipartRequestHandler implementation class used to
process multi-part request data for this Action. |
void |
setName(java.lang.String name)
|
void |
setParameter(java.lang.String parameter)
General purpose configuration parameter that can be used to pass extra information to the Action instance selected by this Action. |
void |
setPath(java.lang.String path)
Set context-relative path of the submitted request, starting with a slash ("/") character, and omitting any filename extension if extension mapping is being used. |
void |
setPrefix(java.lang.String prefix)
|
void |
setRoles(java.lang.String roles)
|
void |
setScope(java.lang.String scope)
|
void |
setSuffix(java.lang.String suffix)
|
void |
setType(java.lang.String type)
|
void |
setUnknown(boolean unknown)
|
void |
setValidate(boolean validate)
|
java.lang.String |
toString()
Return a String representation of this object. |
Methods inherited from class org.apache.struts.config.BaseConfig |
---|
copyProperties, getProperties, getProperty, inheritProperties, setProperties, setProperty, throwIfConfigured |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.HashMap exceptions
The set of exception handling configurations for this action, if
any, keyed by the type
property.
protected java.util.HashMap forwards
The set of local forward configurations for this action, if any,
keyed by the name
property.
protected ModuleConfig moduleConfig
The module configuration with which we are associated.
protected java.lang.String attribute
The request-scope or session-scope attribute name under which our
form bean is accessed, if it is different from the form bean's
specified name
.
protected java.lang.String actionId
The internal identification of this action mapping. Identifications are not inheritable and must be unique within a module.
protected java.lang.String inherit
The path of the ActionConfig that this object should inherit properties from.
protected boolean cancellable
Can this Action be cancelled? [false]
By default, when an Action is cancelled, validation is bypassed and the Action should not execute the business operation. If a request tries to cancel an Action when cancellable is not set, a "InvalidCancelException" is thrown.
protected boolean extensionProcessed
Have the inheritance values for this class been applied?
protected java.lang.String forward
Context-relative path of the web application resource that will
process this request via RequestDispatcher.forward(), instead of
instantiating and calling the Action
class specified by
"type". Exactly one of forward
, include
, or
type
must be specified.
protected java.lang.String include
Context-relative path of the web application resource that will
process this request via RequestDispatcher.include(), instead of
instantiating and calling the Action
class specified by
"type". Exactly one of forward
, include
, or
type
must be specified.
protected java.lang.String input
Context-relative path of the input form to which control should be returned if a validation error is encountered. Required if "name" is specified and the input bean returns validation errors.
protected java.lang.String multipartClass
Fully qualified Java class name of the MultipartRequestHandler
implementation class used to process multi-part request data for this
Action.
protected java.lang.String name
Name of the form bean, if any, associated with this Action.
protected java.lang.String parameter
General purpose configuration parameter that can be used to pass extra information to the Action instance selected by this Action. Struts does not itself use this value in any way.
protected java.lang.String path
Context-relative path of the submitted request, starting with a slash ("/") character, and omitting any filename extension if extension mapping is being used.
protected java.lang.String prefix
Prefix used to match request parameter names to form bean property names, if any.
protected java.lang.String roles
Comma-delimited list of security role names allowed to request this Action.
protected java.lang.String[] roleNames
The set of security role names used to authorize access to this Action, as an array for faster access.
protected java.lang.String scope
Identifier of the scope ("request" or "session") within which our form bean is accessed, if any.
protected java.lang.String suffix
Suffix used to match request parameter names to form bean property names, if any.
protected java.lang.String type
Fully qualified Java class name of the Action
class to
be used to process requests for this mapping if the
forward
and include
properties are not set.
Exactly one of forward
, include
, or
type
must be specified.
protected boolean unknown
Indicates Action be configured as the default one for this module, when true.
protected boolean validate
Should the validate()
method of the form bean
associated with this action be called?
protected java.lang.String command
The name of a commons-chain
command which should be
executed as part of the processing of this action.
protected java.lang.String catalog
The name of a commons-chain
catalog in which
command
should be sought. If a command
is
defined and this property is undefined, the "default" catalog will be
used. This is likely to be infrequently used after a future release of
commons-chain
supports a one-string expression of a
catalog/chain combination.
Constructor Detail |
---|
public ActionConfig()
Method Detail |
---|
public java.lang.String getActionId()
The internal name of this action mapping. If an action has a name, it may be used as a shortcut in a URI. For example, an action with an identification of "editPerson" may be internally forwarded as "editPerson?id=1" which will then resolve to the real URI path at execution time.
public void setActionId(java.lang.String actionId)
The internal name of this action mapping. The name is not inheritable, may not contain a forward slash, and must be unique within a module.
actionId
- the action identifier
java.lang.IllegalStateException
- if the configuration is frozen
java.lang.IllegalArgumentException
- if the identifier contains a forward slashpublic ModuleConfig getModuleConfig()
The module configuration with which we are associated.
public void setModuleConfig(ModuleConfig moduleConfig)
The module configuration with which we are associated.
public java.lang.String getAttribute()
Returns the request-scope or session-scope attribute name under
which our form bean is accessed, if it is different from the form
bean's specified name
.
public void setAttribute(java.lang.String attribute)
Set the request-scope or session-scope attribute name under which
our form bean is accessed, if it is different from the form bean's
specified name
.
attribute
- the request-scope or session-scope attribute name
under which our form bean is access.public boolean getCancellable()
Accessor for cancellable property
public void setCancellable(boolean cancellable)
Mutator for for cancellable property
cancellable
- public java.lang.String getExtends()
Returns the path of the ActionConfig that this object should inherit properties from.
public void setExtends(java.lang.String inherit)
Set the path of the ActionConfig that this object should inherit properties from.
inherit
- the path of the ActionConfig that this object should
inherit properties from.public boolean isExtensionProcessed()
public java.lang.String getForward()
Returns context-relative path of the web application resource that will process this request.
public void setForward(java.lang.String forward)
Set the context-relative path of the web application resource that
will process this request. Exactly one of forward
,
include
, or type
must be specified.
forward
- context-relative path of the web application resource
that will process this request.public java.lang.String getInclude()
Context-relative path of the web application resource that will process this request.
public void setInclude(java.lang.String include)
Set context-relative path of the web application resource that will
process this request. Exactly one of forward
,
include
, or type
must be specified.
include
- context-relative path of the web application resource
that will process this request.public java.lang.String getInput()
Get the context-relative path of the input form to which control should be returned if a validation error is encountered.
public void setInput(java.lang.String input)
Set the context-relative path of the input form to which control should be returned if a validation error is encountered. Required if "name" is specified and the input bean returns validation errors.
input
- context-relative path of the input form to which control
should be returned if a validation error is encountered.public java.lang.String getMultipartClass()
Return the fully qualified Java class name of the
MultipartRequestHandler
implementation class used to
process multi-part request data for this Action.
public void setMultipartClass(java.lang.String multipartClass)
Set the fully qualified Java class name of the
MultipartRequestHandler
implementation class used to
process multi-part request data for this Action.
multipartClass
- fully qualified class name of the
MultipartRequestHandler
implementation class.public java.lang.String getName()
Return name of the form bean, if any, associated with this Action.
public void setName(java.lang.String name)
name
- name of the form bean associated with this Action.public java.lang.String getParameter()
Return general purpose configuration parameter that can be used to pass extra information to the Action instance selected by this Action. Struts does not itself use this value in any way.
public void setParameter(java.lang.String parameter)
General purpose configuration parameter that can be used to pass extra information to the Action instance selected by this Action. Struts does not itself use this value in any way.
parameter
- General purpose configuration parameter.public java.lang.String getPath()
Return context-relative path of the submitted request, starting with a slash ("/") character, and omitting any filename extension if extension mapping is being used.
public void setPath(java.lang.String path)
Set context-relative path of the submitted request, starting with a slash ("/") character, and omitting any filename extension if extension mapping is being used.
path
- context-relative path of the submitted request.public java.lang.String getPrefix()
Retruns prefix used to match request parameter names to form bean property names, if any.
public void setPrefix(java.lang.String prefix)
prefix
- Prefix used to match request parameter names to form bean
property names, if any.public java.lang.String getRoles()
public void setRoles(java.lang.String roles)
public java.lang.String[] getRoleNames()
Get array of security role names used to authorize access to this Action.
public java.lang.String getScope()
Get the scope ("request" or "session") within which our form bean is accessed, if any.
public void setScope(java.lang.String scope)
scope
- scope ("request" or "session") within which our form bean
is accessed, if any.public java.lang.String getSuffix()
Return suffix used to match request parameter names to form bean property names, if any.
public void setSuffix(java.lang.String suffix)
suffix
- Suffix used to match request parameter names to form bean
property names, if any.public java.lang.String getType()
public void setType(java.lang.String type)
public boolean getUnknown()
Determine whether Action is configured as the default one for this module.
public void setUnknown(boolean unknown)
unknown
- Indicates Action is configured as the default one for
this module, when true.public boolean getValidate()
public void setValidate(boolean validate)
public java.lang.String getCommand()
Get the name of a commons-chain
command which should
be executed as part of the processing of this action.
commons-chain
command which should be
executed as part of the processing of this action.public java.lang.String getCatalog()
Get the name of a commons-chain
catalog in which a
specified command should be sought. This is likely to be infrequently
used after a future release of commons-chain
supports a
one-string expression of a catalog/chain combination.
commons-chain
catalog in which a
specified command should be sought.public void setCommand(java.lang.String command)
Set the name of a commons-chain
command which should
be executed as part of the processing of this action.
command
- name of a commons-chain
command which
should be executed as part of the processing of this
action.public void setCatalog(java.lang.String catalog)
Set the name of a commons-chain
catalog in which a
specified command should be sought. This is likely to be infrequently
used after a future release of commons-chain
supports a
one-string expression of a catalog/chain combination.
catalog
- name of a commons-chain
catalog in which a
specified command should be sought.protected boolean checkCircularInheritance(ModuleConfig moduleConfig)
Traces the hierarchy of this object to check if any of the ancestors is extending this instance.
moduleConfig
- The configuration for the module being configured.
protected void inheritExceptionHandlers(ActionConfig baseConfig) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Compare the exception handlers of this action with that of the given and copy those that are not present.
baseConfig
- The action config to copy handlers from.
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
inheritFrom(ActionConfig)
protected void inheritForwards(ActionConfig baseConfig) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Compare the forwards of this action with that of the given and copy those that are not present.
baseConfig
- The action config to copy forwards from.
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
inheritFrom(ActionConfig)
public void addExceptionConfig(ExceptionConfig config)
Add a new ExceptionConfig
instance to the set
associated with this action.
config
- The new configuration instance to be added
java.lang.IllegalStateException
- if this module configuration has been
frozenpublic void addForwardConfig(ForwardConfig config)
Add a new ForwardConfig
instance to the set of global
forwards associated with this action.
config
- The new configuration instance to be added
java.lang.IllegalStateException
- if this module configuration has been
frozenpublic ExceptionConfig findExceptionConfig(java.lang.String type)
Return the exception configuration for the specified type, if any;
otherwise return null
.
type
- Exception class name to find a configuration forpublic ExceptionConfig[] findExceptionConfigs()
Return the exception configurations for this action. If there are none, a zero-length array is returned.
public ExceptionConfig findException(java.lang.Class type)
Find and return the ExceptionConfig
instance defining
how Exceptions
of the specified type should be handled.
This is performed by checking local and then global configurations for
the specified exception's class, and then looking up the superclass
chain (again checking local and then global configurations). If no
handler configuration can be found, return null
.
Introduced in ActionMapping
in Struts 1.1, but pushed
up to ActionConfig
in Struts 1.2.0.
type
- Exception class for which to find a handlerpublic ForwardConfig findForwardConfig(java.lang.String name)
Return the forward configuration for the specified key, if any;
otherwise return null
.
name
- Name of the forward configuration to returnpublic ForwardConfig[] findForwardConfigs()
Return all forward configurations for this module. If there are none, a zero-length array is returned.
public void freeze()
Freeze the configuration of this action.
freeze
in class BaseConfig
public void inheritFrom(ActionConfig config) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.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 config
is extending another object, those
extensions should be resolved before it's used as a parameter to this
method.
config
- The object that this instance will be inheriting its
values from.
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
processExtends(ModuleConfig)
public void processExtends(ModuleConfig moduleConfig) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
Inherit configuration information from the ActionConfig that this instance is extending. This method verifies that any action config object that it inherits from has also had its processExtends() method called.
moduleConfig
- The ModuleConfig
that this bean is from.
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
inheritFrom(ActionConfig)
public void removeExceptionConfig(ExceptionConfig config)
Remove the specified exception configuration instance.
config
- ExceptionConfig instance to be removed
java.lang.IllegalStateException
- if this module configuration has been
frozenpublic void removeForwardConfig(ForwardConfig config)
Remove the specified forward configuration instance.
config
- ForwardConfig instance to be removed
java.lang.IllegalStateException
- if this module configuration has been
frozenpublic java.lang.String toString()
Return a String representation of this object.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |