Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.dispatcher
Class ServletActionRedirectResult

    java.lang.Object
      org.apache.struts2.dispatcher.StrutsResultSupport
          org.apache.struts2.dispatcher.ServletRedirectResult
              org.apache.struts2.dispatcher.ServletActionRedirectResult

All Implemented Interfaces:
  Result, Serializable, StrutsStatics

    public class ServletActionRedirectResult

extends ServletRedirectResult

This result uses the `ActionMapper` provided by the `ActionMapperFactory` to redirect the browser to a URL that invokes the specified action and (optional) namespace. This is better than the `ServletRedirectResult` because it does not require you to encode the URL patterns processed by the `ActionMapper` in to your struts.xml configuration files. This means you can change your URL patterns at any point and your application will still work. It is strongly recommended that if you are redirecting to another action, you use this result rather than the standard redirect result.

See Also:
  `ActionMapper`, Serialized Form

Field Summary
`protected String` | `actionName`
`static String` | `DEFAULT_PARAM` The default parameter
`protected String` | `method`
`protected String` | `namespace`
`protected List<String>` | `prohibitedResultParam`
`private Map<String,String>` | `requestParameters`
`private static long` | `serialVersionUID`

Fields inherited from class org.apache.struts2.dispatcher.ServletRedirectResult
`actionMapper, prependServletContext`

Fields inherited from interface org.apache.struts2.StrutsStatics
`HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_PORTLET_CONTEXT`

Constructor Summary
`ServletActionRedirectResult()`
`ServletActionRedirectResult(String actionName)`
`ServletActionRedirectResult(String actionName, String method)`
`ServletActionRedirectResult(String namespace, String actionName, String method)`

Method Summary
`ServletActionRedirectResult` | `addParameter(String key, Object value)` Adds a request parameter to be added to the redirect url
`void` | `execute(ActionInvocation invocation)` Implementation of the `execute` method from the `Result` interface.
`void` | `setActionName(String actionName)` Sets the action name
`void` | `setMethod(String method)` Sets the method
`void` | `setNamespace(String namespace)` Sets the namespace

Methods inherited from class org.apache.struts2.dispatcher.ServletRedirectResult
`doExecute, setActionMapper, setPrependServletContext`

Methods inherited from class org.apache.struts2.dispatcher.StrutsResultSupport
`conditionalParse, getLastFinalLocation, setEncode, setLocation, setParse`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### serialVersionUID

    private static final long serialVersionUID

See Also:
  Constant Field Values

### DEFAULT_PARAM

    public static final String DEFAULT_PARAM

  The default parameter

  See Also:
    Constant Field Values

### actionName

    protected String actionName

### namespace

    protected String namespace

### method

    protected String method

### requestParameters

    private Map<String,String> requestParameters

### prohibitedResultParam

    protected List<String> prohibitedResultParam

Constructor Detail

### ServletActionRedirectResult

    public ServletActionRedirectResult()

### ServletActionRedirectResult

    public ServletActionRedirectResult(String actionName)

### ServletActionRedirectResult

    public ServletActionRedirectResult(String actionName,
                                       String method)

### ServletActionRedirectResult

    public ServletActionRedirectResult(String namespace,
                                       String actionName,
                                       String method)

Method Detail

### execute

    public void execute(ActionInvocation invocation)
                 throws Exception

  Description copied from class: `StrutsResultSupport`
  Implementation of the `execute` method from the `Result` interface. This will call the abstract method `StrutsResultSupport.doExecute(String, ActionInvocation)` after optionally evaluating the location as an OGNL evaluation.

  Specified by:
    `execute` in interface `Result`
  Overrides:
    `execute` in class `StrutsResultSupport`
  Parameters:
    `invocation` - the execution state of the action.
  Throws:
    `Exception` - if an error occurs while executing the result.
  See Also:
    `Result.execute(com.opensymphony.xwork2.ActionInvocation)`

### setActionName

    public void setActionName(String actionName)

  Sets the action name

  Parameters:
    `actionName` - The name

### setNamespace

    public void setNamespace(String namespace)

  Sets the namespace

  Parameters:
    `namespace` - The namespace

### setMethod

    public void setMethod(String method)

  Sets the method

  Parameters:
    `method` - The method

### addParameter

    public ServletActionRedirectResult addParameter(String key,
                                                    Object value)

  Adds a request parameter to be added to the redirect url

  Parameters:
    `key` - The parameter name
    `value` - The parameter value

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.