Interface ModuleConfig
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ModuleConfigImpl
The collection of static configuration information that describes a Struts-based module. Multiple modules are identified by a prefix at the beginning of the context relative portion of the request URI. If no module prefix can be matched, the default configuration (with a prefix equal to a zero-length string) is selected, which is elegantly backwards compatible with the previous Struts behavior that only supported one module.
- Since:
- Struts 1.1
- Version:
- $Rev$ $Date: 2005-08-06 04:12:10 -0400 (Sat, 06 Aug 2005) $
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addActionConfig
(ActionConfig config) Add a newActionConfig
instance to the set associated with this module.void
addExceptionConfig
(ExceptionConfig config) Add a newExceptionConfig
instance to the set associated with this module.void
addFormBeanConfig
(FormBeanConfig config) Add a newFormBeanConfig
instance to the set associated with this module.void
addForwardConfig
(ForwardConfig config) Add a newForwardConfig
instance to the set of global forwards associated with this module.void
Add a newMessageResourcesConfig
instance to the set associated with this module.void
addPlugInConfig
(PlugInConfig plugInConfig) Add a newly configuredPlugInConfig
instance to the set of plug-in Actions for this module.findActionConfig
(String path) Return the action configuration for the specified path, if any; otherwise returnnull
.findActionConfigId
(String actionId) Returns the action configuration for the specifed action action identifier.Return the action configurations for this module.findException
(Class<?> type) Perform a recursive search for an ExceptionConfig registered for this class, or for any superclass.findExceptionConfig
(String type) Return the exception configuration for the specified type, if any; otherwise returnnull
.Return the exception configurations for this module.findFormBeanConfig
(String name) Return the form bean configuration for the specified key, if any; otherwise returnnull
.Return the form bean configurations for this module.findForwardConfig
(String name) Return the forward configuration for the specified key, if any; otherwise returnnull
.Return the form bean configurations for this module.Return the message resources configuration for the specified key, if any; otherwise returnnull
.Return the message resources configurations for this module.Return the configured plug-in actions for this module.void
freeze()
Freeze the configuration of this module.The default class name to be used when creating action form bean instances.The default class name to be used when creating action forward instances.The default class name to be used when creating action mapping instances.boolean
Has this module been completely configured yet.The controller configuration object for this module.The prefix of the context-relative portion of the request URI, used to select this configuration versus others supported by the controller servlet.void
removeActionConfig
(ActionConfig config) Remove the specified action configuration instance.void
removeExceptionConfig
(ExceptionConfig config) Remove the specified exception configuration instance.void
removeFormBeanConfig
(FormBeanConfig config) Remove the specified form bean configuration instance.void
removeForwardConfig
(ForwardConfig config) Remove the specified forward configuration instance.void
Remove the specified message resources configuration instance.void
setActionFormBeanClass
(String actionFormBeanClass) The default class name to be used when creating action form bean instances.void
setActionForwardClass
(String actionForwardClass) The default class name to be used when creating action forward instances.void
setActionMappingClass
(String actionMappingClass) The default class name to be used when creating action mapping instances.void
The controller configuration object for this module.void
The prefix of the context-relative portion of the request URI, used to select this configuration versus others supported by the controller servlet.
-
Method Details
-
getConfigured
boolean getConfigured()Has this module been completely configured yet. Once this flag has been set, any attempt to modify the configuration will return an IllegalStateException.
-
getControllerConfig
ControllerConfig getControllerConfig()The controller configuration object for this module.
-
setControllerConfig
The controller configuration object for this module.
- Parameters:
cc
- The controller configuration object for this module.
-
getPrefix
String getPrefix()The prefix of the context-relative portion of the request URI, used to select this configuration versus others supported by the controller servlet. A configuration with a prefix of a zero-length String is the default configuration for this web module.
-
setPrefix
The prefix of the context-relative portion of the request URI, used to select this configuration versus others supported by the controller servlet. A configuration with a prefix of a zero-length String is the default configuration for this web module.
- Parameters:
prefix
- The prefix of the context-relative portion of the request URI.
-
getActionFormBeanClass
String getActionFormBeanClass()The default class name to be used when creating action form bean instances.
-
setActionFormBeanClass
The default class name to be used when creating action form bean instances.
- Parameters:
actionFormBeanClass
- default class name to be used when creating action form bean instances.
-
getActionMappingClass
String getActionMappingClass()The default class name to be used when creating action mapping instances.
-
setActionMappingClass
The default class name to be used when creating action mapping instances.
- Parameters:
actionMappingClass
- default class name to be used when creating action mapping instances.
-
addActionConfig
Add a new
ActionConfig
instance to the set associated with this module.- Parameters:
config
- The new configuration instance to be added- Throws:
IllegalStateException
- if this module configuration has been frozen
-
addExceptionConfig
Add a new
ExceptionConfig
instance to the set associated with this module.- Parameters:
config
- The new configuration instance to be added- Throws:
IllegalStateException
- if this module configuration has been frozen
-
addFormBeanConfig
Add a new
FormBeanConfig
instance to the set associated with this module.- Parameters:
config
- The new configuration instance to be added- Throws:
IllegalStateException
- if this module configuration has been frozen
-
getActionForwardClass
String getActionForwardClass()The default class name to be used when creating action forward instances.
-
setActionForwardClass
The default class name to be used when creating action forward instances.
- Parameters:
actionForwardClass
- default class name to be used when creating action forward instances.
-
addForwardConfig
Add a new
ForwardConfig
instance to the set of global forwards associated with this module.- Parameters:
config
- The new configuration instance to be added- Throws:
IllegalStateException
- if this module configuration has been frozen
-
addMessageResourcesConfig
Add a new
MessageResourcesConfig
instance to the set associated with this module.- Parameters:
config
- The new configuration instance to be added- Throws:
IllegalStateException
- if this module configuration has been frozen
-
addPlugInConfig
Add a newly configured
PlugInConfig
instance to the set of plug-in Actions for this module.- Parameters:
plugInConfig
- The new configuration instance to be added
-
findActionConfig
Return the action configuration for the specified path, if any; otherwise return
null
.- Parameters:
path
- Path of the action configuration to return
-
findActionConfigs
ActionConfig[] findActionConfigs()Return the action configurations for this module. If there are none, a zero-length array is returned.
-
findActionConfigId
Returns the action configuration for the specifed action action identifier.
- Parameters:
actionId
- the action identifier- Returns:
- the action config if found; otherwise
null
- Since:
- Struts 1.3.6
- See Also:
-
findExceptionConfig
Return the exception configuration for the specified type, if any; otherwise return
null
.- Parameters:
type
- Exception class name to find a configuration for
-
findException
Perform a recursive search for an ExceptionConfig registered for this class, or for any superclass. This should only be used in the case when an
ActionConfig
is not available; otherwise, useActionConfig.findException(Class)
to preserve the search order.- Parameters:
type
- Exception class name to find a configuration for- See Also:
-
findExceptionConfigs
ExceptionConfig[] findExceptionConfigs()Return the exception configurations for this module. If there are none, a zero-length array is returned.
-
findFormBeanConfig
Return the form bean configuration for the specified key, if any; otherwise return
null
.- Parameters:
name
- Name of the form bean configuration to return
-
findFormBeanConfigs
FormBeanConfig[] findFormBeanConfigs()Return the form bean configurations for this module. If there are none, a zero-length array is returned.
-
findForwardConfig
Return the forward configuration for the specified key, if any; otherwise return
null
.- Parameters:
name
- Name of the forward configuration to return
-
findForwardConfigs
ForwardConfig[] findForwardConfigs()Return the form bean configurations for this module. If there are none, a zero-length array is returned.
-
findMessageResourcesConfig
Return the message resources configuration for the specified key, if any; otherwise return
null
.- Parameters:
key
- Key of the data source configuration to return
-
findMessageResourcesConfigs
MessageResourcesConfig[] findMessageResourcesConfigs()Return the message resources configurations for this module. If there are none, a zero-length array is returned.
-
findPlugInConfigs
PlugInConfig[] findPlugInConfigs()Return the configured plug-in actions for this module. If there are none, a zero-length array is returned.
-
freeze
void freeze()Freeze the configuration of this module. After this method returns, any attempt to modify the configuration will return an IllegalStateException.
-
removeActionConfig
Remove the specified action configuration instance.
- Parameters:
config
- ActionConfig instance to be removed- Throws:
IllegalStateException
- if this module configuration has been frozen
-
removeExceptionConfig
Remove the specified exception configuration instance.
- Parameters:
config
- ActionConfig instance to be removed- Throws:
IllegalStateException
- if this module configuration has been frozen
-
removeFormBeanConfig
Remove the specified form bean configuration instance.
- Parameters:
config
- FormBeanConfig instance to be removed- Throws:
IllegalStateException
- if this module configuration has been frozen
-
removeForwardConfig
Remove the specified forward configuration instance.
- Parameters:
config
- ForwardConfig instance to be removed- Throws:
IllegalStateException
- if this module configuration has been frozen
-
removeMessageResourcesConfig
Remove the specified message resources configuration instance.
- Parameters:
config
- MessageResourcesConfig instance to be removed- Throws:
IllegalStateException
- if this module configuration has been frozen
-