| org.apache.struts.config.ForwardConfig org.apache.struts.action.ActionForward org.apache.struts.action.ActionRedirect
ActionRedirect | public class ActionRedirect extends ActionForward (Code) | | A subclass of
ActionForward which is designed for use in
redirecting requests, with support for adding parameters at runtime.
An
ForwardConfig (or subclass) can be passed to the constructor to
copy its configuration:
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
ActionRedirect redirect =
new ActionRedirect(mapping.findForward("doRedirect"));
redirect.addParameter("param1","value1");
redirect.addParameter("param2","2");
redirect.addParameter("param3","3.0");
return redirect;
}
version: $Rev: 513602 $ $Date: 2007-03-01 20:50:23 -0600 (Thu, 01 Mar 2007) $ |
LOG | final protected static Log LOG(Code) | | Commons logging instance.
|
anchorValue | protected String anchorValue(Code) | | Holds the anchor value.
|
parameterValues | protected Map parameterValues(Code) | | Holds the redirect parameters. Each entry is either a String or a
String[] depending on whether it has one or more entries.
|
ActionRedirect | public ActionRedirect()(Code) | | Construct a new instance with redirect set to true and initialize
parameter lists.
|
ActionRedirect | public ActionRedirect(String path)(Code) | | Construct a new instance with the specified path and initialize
parameter lists.
Parameters: path - Path for this instance |
ActionRedirect | public ActionRedirect(String name, String path, String module)(Code) | | Construct a new instance with the specified values and initialize
parameter lists.
Parameters: name - Name of this instance Parameters: path - Path for this instance Parameters: module - Module prefix, if any |
ActionRedirect | public ActionRedirect(ForwardConfig baseConfig)(Code) | | Construct a new instance with a
ForwardConfig object to copy
name, path, contextRelative, and arbitrary property values from.
Parameters: baseConfig - the ForwardConfig to copy configurationvalues from |
addParameter | public ActionRedirect addParameter(String fieldName, Object valueObj)(Code) | | Adds the object's toString() to the list of parameters if it's not
null, or an empty string with the given fieldName if it is.
Parameters: fieldName - the name to use for the parameter Parameters: valueObj - the value for this parameter The ActionRedirect instance this method is called on |
getAnchorString | public String getAnchorString()(Code) | | Forms the string containing the parameters
passed onto this object thru calls to addParameter().
a string which can be appended to the URLs. Thereturn string includes a leading hashmark (#). |
getOriginalPath | public String getOriginalPath()(Code) | | Get the original path without the parameters added at runtime.
the original path as configured. |
getParameterString | public String getParameterString()(Code) | | Forms the string containing the parameters passed onto this object
thru calls to addParameter().
a string which can be appended to the URLs. The return stringdoes not include a leading question mark (?). |
getPath | public String getPath()(Code) | | Get the path for this object, including any parameters that may have
been added at runtime.
The path for this object. |
setAnchor | public ActionRedirect setAnchor(String anchorValue)(Code) | | Adds an anchor to the path. Technically, the anchor value is
just stored for later and will be added to the path in getPath().
Note that this is a considerably simpler method than the
addParmaeter method because aside from encoding the value, there
isn't really anything to do. Passing in null is fine because that
is the value that will be checked for later to determine whether
to append an anchor to the path or not.
Parameters: anchorValue - The anchor to append to the path The ActionRefirect instance this method is called on |
toString | public String toString()(Code) | | Return a string description of this object.
a string containing the original path for this object and theparameters it currently holds |
|
|