|
||||||||||
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.ForwardConfig
public class ForwardConfig
A JavaBean representing the configuration information of a
<forward>
element from a Struts configuration file.
Field Summary | |
---|---|
protected String |
catalog
The name of a commons-chain catalog in which
command should be looked up. |
protected String |
command
The name of a commons-chain command which should be
looked up and executed before Struts dispatches control to the view
represented by this config. |
protected boolean |
extensionProcessed
Have the inheritance values for this class been applied? |
protected String |
inherit
The name of the ForwardConfig that this object should inherit properties from. |
protected String |
module
The prefix of the module to which this ForwardConfig
entry points, which must start with a slash ("/") character. |
protected String |
name
The unique identifier of this forward, which is used to reference it in Action classes. |
protected String |
path
The URL to which this ForwardConfig entry points, which
must start with a slash ("/") character. |
protected boolean |
redirect
Should a redirect be used to transfer control to the specified path? |
Fields inherited from class org.apache.struts.config.BaseConfig |
---|
configured |
Constructor Summary | |
---|---|
ForwardConfig()
Construct a new instance with default values. |
|
ForwardConfig(ForwardConfig copyMe)
Construct a new instance based on the values of another ForwardConfig. |
|
ForwardConfig(String name,
String path,
boolean redirect)
Construct a new instance with the specified values. |
|
ForwardConfig(String name,
String path,
boolean redirect,
String module)
Construct a new instance with the specified values. |
Method Summary | |
---|---|
protected boolean |
checkCircularInheritance(ModuleConfig moduleConfig,
ActionConfig actionConfig)
Traces the hierarchy of this object to check if any of the ancestors are extending this instance. |
String |
getCatalog()
|
String |
getCommand()
|
String |
getExtends()
|
String |
getModule()
|
String |
getName()
|
String |
getPath()
|
boolean |
getRedirect()
|
void |
inheritFrom(ForwardConfig config)
Inherit values that have not been overridden from the provided config object. |
boolean |
isExtensionProcessed()
|
void |
processExtends(ModuleConfig moduleConfig,
ActionConfig actionConfig)
Inherit configuration information from the ForwardConfig that this instance is extending. |
void |
setCatalog(String catalog)
|
void |
setCommand(String command)
|
void |
setExtends(String inherit)
|
void |
setModule(String module)
|
void |
setName(String name)
|
void |
setPath(String path)
|
void |
setRedirect(boolean redirect)
|
String |
toString()
Return a String representation of this object. |
Methods inherited from class org.apache.struts.config.BaseConfig |
---|
copyProperties, freeze, 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 String inherit
protected boolean extensionProcessed
protected String name
Action
classes.
protected String path
The URL to which this ForwardConfig
entry points, which
must start with a slash ("/") character. It is interpreted according
to the following rules:
contextRelative
property is true
, the
path is considered to be context-relative within the current web
application (even if we are in a named module). It will be prefixed by
the context path to create a server-relative URL.contextRelative
property is false, the path is
considered to be the module-relative portion of the URL. It will be
used as the replacement for the $P
marker in the
forwardPattern
property defined on the ControllerConfig
element for our current module. For the default
forwardPattern
value of $C$M$P
, the resulting
server-relative URL will be the concatenation of the context path, the
module prefix, and the path
from this
ForwardConfig
.
protected String module
The prefix of the module to which this ForwardConfig
entry points, which must start with a slash ("/") character.
Usage note: If a forward config is used in a hyperlink, and a module is specified, the path must lead to another action and not directly to a page. This is in keeping with rule that in a modular application all links must be to an action rather than a page.
protected boolean redirect
protected String command
The name of a commons-chain
command which should be
looked up and executed before Struts dispatches control to the view
represented by this config.
protected String catalog
The name of a commons-chain
catalog in which
command
should be looked up. If this value is undefined,
then the command will be looked up in the "default" catalog. This
value has no meaning except in the context of the command
property.
Constructor Detail |
---|
public ForwardConfig()
public ForwardConfig(String name, String path, boolean redirect)
name
- Name of this forwardpath
- Path to which control should be forwarded or
redirectedredirect
- Should we do a redirect?public ForwardConfig(String name, String path, boolean redirect, String module)
Construct a new instance with the specified values.
name
- Name of this forwardpath
- Path to which control should be forwarded or
redirectedredirect
- Should we do a redirect?module
- Module prefix, if anypublic ForwardConfig(ForwardConfig copyMe)
Construct a new instance based on the values of another ForwardConfig.
copyMe
- A ForwardConfig instance to copyMethod Detail |
---|
public String getExtends()
public void setExtends(String inherit)
public boolean isExtensionProcessed()
public String getName()
public void setName(String name)
public String getPath()
public void setPath(String path)
public String getModule()
public void setModule(String module)
public boolean getRedirect()
public void setRedirect(boolean redirect)
public String getCommand()
public void setCommand(String command)
public String getCatalog()
public void setCatalog(String catalog)
protected boolean checkCircularInheritance(ModuleConfig moduleConfig, ActionConfig actionConfig)
Traces the hierarchy of this object to check if any of the ancestors are extending this instance.
moduleConfig
- The ModuleConfig
that this config is from.actionConfig
- The ActionConfig
that this config is from,
if applicable. This parameter must be null if this
forward config is a global forward.
public void inheritFrom(ForwardConfig 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 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.
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
processExtends(ModuleConfig, ActionConfig)
public void processExtends(ModuleConfig moduleConfig, ActionConfig actionConfig) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException
Inherit configuration information from the ForwardConfig that this instance is extending. This method verifies that any forward config object that it inherits from has also had its processExtends() method called.
moduleConfig
- The ModuleConfig
that this config is from.actionConfig
- The ActionConfig
that this config is from,
if applicable. This must be null for global
forwards.
ClassNotFoundException
IllegalAccessException
InstantiationException
InvocationTargetException
inheritFrom(ForwardConfig)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |