Home » struts-2.1.8.1-src » org.apache » struts2 » portlet » result » [javadoc | source]
org.apache.struts2.portlet.result
public class: PortletActionRedirectResult [javadoc | source]
java.lang.Object
   org.apache.struts2.dispatcher.StrutsResultSupport
      org.apache.struts2.portlet.result.PortletResult
         org.apache.struts2.portlet.result.PortletActionRedirectResult

All Implemented Interfaces:
    com.opensymphony.xwork2.util.reflection.ReflectionExceptionHandler, PortletActionConstants, com.opensymphony.xwork2.Result, StrutsStatics

Portlet modification of the ServletActionRedirectResult . This result uses the ActionMapper provided by the ActionMapperFactory to instruct the render phase to invoke the specified action and (optional) namespace. This is better than the PortletResult 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 examples below for an example of how request parameters could be passed in. This result type takes the following parameters: Example:
<!-- START SNIPPET: example -->
 <package name="public" extends="struts-default">
     <action name="login" class="...">
         <!-- Redirect to another namespace -->
         <result type="redirectAction">
             <param name="actionName">dashboard</param>
             <param name="namespace">/secure</param>
         </result>
     </action>
 </package>

 <package name="secure" extends="struts-default" namespace="/secure">
     <-- Redirect to an action in the same namespace -->
     <action name="dashboard" class="...">
         <result>dashboard.jsp</result>
         <result name="error" type="redirectAction">error</result>
     </action>

     <action name="error" class="...">
         <result>error.jsp</result>
     </action>
 </package>

 <package name="passingRequestParameters" extends="struts-default" namespace="/passingRequestParameters">
    <-- Pass parameters (reportType, width and height) -->
    <!--
    The redirectAction url generated will be :
    /genReport/generateReport.action?reportType=pie&width=100&height=100
    -->
    <action name="gatherReportInfo" class="...">
       <result name="showReportResult" type="redirectAction">
          <param name="actionName">generateReport</param>
          <param name="namespace">/genReport</param>
          <param name="reportType">pie</param>
          <param name="width">100</param>
          <param name="height">100</param>
       </result>
    </action>
 </package>


 <!-- END SNIPPET: example -->
Field Summary
public static final  String DEFAULT_PARAM    The default parameter 
protected  String actionName     
protected  String namespace     
protected  String method     
protected  List<String> prohibitedResultParam     
Fields inherited from org.apache.struts2.portlet.result.PortletResult:
portletMode
Fields inherited from org.apache.struts2.dispatcher.StrutsResultSupport:
DEFAULT_PARAM
Constructor:
 public PortletActionRedirectResult() 
 public PortletActionRedirectResult(String actionName) 
 public PortletActionRedirectResult(String actionName,
    String method) 
 public PortletActionRedirectResult(String namespace,
    String actionName,
    String method) 
Method from org.apache.struts2.portlet.result.PortletActionRedirectResult Summary:
addParameter,   execute,   handle,   setActionMapper,   setActionName,   setMethod,   setNamespace
Methods from org.apache.struts2.portlet.result.PortletResult:
convertQueryParamsToRenderParams,   doExecute,   executeActionResult,   executeRenderResult,   setContentType,   setDispatcherServletName,   setPortletMode,   setTitle,   setUseDispatcherServlet
Methods from org.apache.struts2.dispatcher.StrutsResultSupport:
conditionalParse,   doExecute,   execute,   getLastFinalLocation,   getLocation,   setEncode,   setLocation,   setParse
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.struts2.portlet.result.PortletActionRedirectResult Detail:
 public PortletActionRedirectResult addParameter(String key,
    Object value) 
    Adds a request parameter to be added to the redirect url
 public  void execute(ActionInvocation invocation) throws Exception 
 public  void handle(ReflectionException ex) 
 public  void setActionMapper(ActionMapper actionMapper) 
 public  void setActionName(String actionName) 
    Sets the action name
 public  void setMethod(String method) 
    Sets the method
 public  void setNamespace(String namespace) 
    Sets the namespace