org.apache.struts.config
public class ActionConfig extends Object implements Serializable
A JavaBean representing the configuration information of an
<action>
element from a Struts
module configuration file.
Since: Struts 1.1
Version: $Rev: 377805 $ $Date: 2006-02-14 19:26:15 +0000 (Tue, 14 Feb 2006) $
Field Summary | |
---|---|
protected 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? |
protected boolean | configured
Indicates if configuration of this component been completed. |
protected HashMap | exceptions
The set of exception handling configurations for this
action, if any, keyed by the type property. |
protected 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 HashMap | forwards
The set of local forward configurations for this action, if any,
keyed by the name property. |
protected 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 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 String | multipartClass
Fully qualified Java class name of the
MultipartRequestHandler implementation class used to
process multi-part request data for this Action. |
protected String | name
Name of the form bean, if any, associated with this Action. |
protected String | parameter
General purpose configuration parameter that can be used to pass
extra information to the Action instance selected by this Action.
|
protected 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 String | prefix
Prefix used to match request parameter names to form bean property
names, if any. |
protected String[] | roleNames
The set of security role names used to authorize access to this
Action, as an array for faster access. |
protected String | roles
Comma-delimited list of security role names allowed to request
this Action. |
protected String | scope
Identifier of the scope ("request" or "session") within which
our form bean is accessed, if any. |
protected String | suffix
Suffix used to match request parameter names to form bean property
names, if any. |
protected 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? |
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.
|
ExceptionConfig | findException(Class type) Find and return the |
ExceptionConfig | findExceptionConfig(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(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. |
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 |
String | getForward()
Returns context-relative path of the web application resource that will process
this request. |
String | getInclude()
Context-relative path of the web application resource that will process
this request. |
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. |
String | getMultipartClass()
Return the fully qualified Java class name of the
MultipartRequestHandler implementation class used to
process multi-part request data for this Action. |
String | getName()
Return name of the form bean, if any, associated with this Action. |
String | getParameter()
Return general purpose configuration parameter that can be used to pass
extra information to the Action instance selected by this Action.
|
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. |
String | getPrefix()
Retruns prefix used to match request parameter names to form bean property
names, if any. |
String[] | getRoleNames()
Get array of security role names used to authorize access to this
Action. |
String | getRoles() |
String | getScope()
Get the scope ("request" or "session") within which
our form bean is accessed, if any. |
String | getSuffix()
Return suffix used to match request parameter names to form bean property
names, if any. |
String | getType() |
boolean | getUnknown()
Determine whether Action is configured as the default one for this
module. |
boolean | getValidate() |
void | removeExceptionConfig(ExceptionConfig config)
Remove the specified exception configuration instance.
|
void | removeForwardConfig(ForwardConfig config)
Remove the specified forward configuration instance.
|
void | setAttribute(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 | setForward(String forward)
Set the context-relative path of the web application resource that will process
this request.
|
void | setInclude(String include)
Set context-relative path of the web application resource that will process
this request.
|
void | setInput(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(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(String name) |
void | setParameter(String parameter)
General purpose configuration parameter that can be used to pass
extra information to the Action instance selected by this Action.
|
void | setPath(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(String prefix) |
void | setRoles(String roles) |
void | setScope(String scope) |
void | setSuffix(String suffix) |
void | setType(String type) |
void | setUnknown(boolean unknown) |
void | setValidate(boolean validate) |
String | toString()
Return a String representation of this object. |
name
.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.
Since: Struts 1.2.9
type
property.Action
class specified by "type".
Exactly one of forward
, include
, or
type
must be specified.name
property.Action
class specified by "type".
Exactly one of forward
, include
, or
type
must be specified.MultipartRequestHandler
implementation class used to
process multi-part request data for this Action.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.validate()
method of the form bean associated
with this action be called?ExceptionConfig
instance to the set associated
with this action.
Parameters: config The new configuration instance to be added
Throws: IllegalStateException if this module configuration has been frozen
ForwardConfig
instance to the set of global
forwards associated with this action.
Parameters: config The new configuration instance to be added
Throws: IllegalStateException if this module configuration has been frozen
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.
Parameters: type Exception class for which to find a handler
Since: Struts 1.2.0
null
.
Parameters: type Exception class name to find a configuration for
null
.
Parameters: name Name of the forward configuration to return
name
.Returns: attribute name under which our form bean is accessed.
Accessor for cancellable property
Returns: True if Action can be cancelled
Since: Struts 1.2.9
Returns: context-relative path of the web application resource that will process this request.
Returns: Context-relative path of the web application resource that will process this request.
Returns: context-relative path of the input form to which control should be returned if a validation error is encountered.
MultipartRequestHandler
implementation class used to
process multi-part request data for this Action.Parameters: config ExceptionConfig instance to be removed
Throws: IllegalStateException if this module configuration has been frozen
Parameters: config ForwardConfig instance to be removed
Throws: IllegalStateException if this module configuration has been frozen
name
.Parameters: attribute the request-scope or session-scope attribute name under which our form bean is access.
Mutator for for cancellable property
Parameters: cancellable
Since: Struts 1.2.9
forward
, include
, or
type
must be specified.Parameters: forward context-relative path of the web application resource that will process this request.
forward
, include
, or
type
must be specified.Parameters: include context-relative path of the web application resource that will process this request.
Parameters: input context-relative path of the input form to which control should be returned if a validation error is encountered.
MultipartRequestHandler
implementation class used to
process multi-part request data for this Action.Parameters: multipartClass fully qualified class name of the
MultipartRequestHandler
implementation class.
Parameters: name name of the form bean associated with this Action.
Parameters: parameter General purpose configuration parameter.
Parameters: path context-relative path of the submitted request.
Parameters: prefix Prefix used to match request parameter names to form bean property names, if any.
Parameters: scope scope ("request" or "session") within which our form bean is accessed, if any.
Parameters: suffix Suffix used to match request parameter names to form bean property names, if any.
Parameters: unknown Indicates Action is configured as the default one for this module, when true.