org.apache.struts.action
public class ActionRedirect extends ActionForward
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;
}
Since: Struts 1.2.7
Version: $Rev: 164747 $ $Date: 2005-04-26 06:47:48 +0100 (Tue, 26 Apr 2005) $
Field Summary | |
---|---|
protected static Log | log Commons logging instance. |
protected Map | parameterValues Holds the redirect parameters. |
Constructor Summary | |
---|---|
ActionRedirect() Construct a new instance with redirect set to true and initialize parameter lists. | |
ActionRedirect(String path) Construct a new instance with the specified path and initialize parameter lists. | |
ActionRedirect(String name, String path, String module) Construct a new instance with the specified values and initialize parameter lists. | |
ActionRedirect(ForwardConfig baseConfig) Construct a new instance with a {@link ForwardConfig} object to copy name, path, and contextRelative values from. |
Method Summary | |
---|---|
void | addParameter(String fieldName, Object valueObj) 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. |
String | getOriginalPath() Get the original path without the parameters added at runtime. |
String | getParameterString() Forms the string containing the parameters passed onto this object thru calls to addParameter(). |
String | getPath() Get the path for this object, including any parameters that may have been added at runtime. |
void | initializeParameters() Initializes the internal objects used to hold parameter values. |
String | toString() Return a string description of this object. |
Commons logging instance.
Holds the redirect parameters. Each entry is either a String or a String[] depending on whether it has one or more entries.
Construct a new instance with redirect set to true and initialize parameter lists.
Construct a new instance with the specified path and initialize parameter lists.
Parameters: path Path for this instance
Construct a new instance with the specified values and initialize parameter lists.
Parameters: name Name of this instance path Path for this instance module Module prefix, if any
Construct a new instance with a {@link ForwardConfig} object to copy name, path, and contextRelative values from.
Parameters: baseConfig the {@link ForwardConfig} to copy configuration values from
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 valueObj the value for this parameter
Get the original path without the parameters added at runtime.
Returns: the original path as configured.
Forms the string containing the parameters passed onto this object thru calls to addParameter().
Returns: a string which can be appended to the URLs. The return string does not include a leading question mark (?).
Get the path for this object, including any parameters that may have been added at runtime.
Initializes the internal objects used to hold parameter values.
Return a string description of this object.
Returns: a string containing the original path for this object and the parameters it currently holds