Class ForwardParameters


  • public class ForwardParameters
    extends java.lang.Object
    Utility wrapper class for programatically adding parameters to ActionForward paths. The redirect property of the new ActionForward returned by forward() will be equal to the redirect setting of the original ActionForward.
    Author:
    tom
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.struts.action.ActionForward af
      Original ActionForward.
      protected java.lang.String anchor
      Anchor name.
      protected java.util.Map<java.lang.String,​java.lang.String> params
      Map from parameter name to parameter value.
    • Constructor Summary

      Constructors 
      Constructor Description
      ForwardParameters​(java.lang.String path, boolean redirect)
      Creates a new instance of ForwardParameters with a given path and redirect settings.
      ForwardParameters​(org.apache.struts.action.ActionForward af)
      Creates a new instance of ForwardParameters.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ForwardParameters addAnchor​(java.lang.String newAnchor)
      Add an anchor to the path.
      ForwardParameters addParameter​(java.lang.String name, java.lang.String value)
      Add a parameter to the path.
      org.apache.struts.action.ActionForward forward()
      Construct the resulting ActionForward.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • af

        protected org.apache.struts.action.ActionForward af
        Original ActionForward.
      • params

        protected java.util.Map<java.lang.String,​java.lang.String> params
        Map from parameter name to parameter value.
      • anchor

        protected java.lang.String anchor
        Anchor name.
    • Constructor Detail

      • ForwardParameters

        public ForwardParameters​(org.apache.struts.action.ActionForward af)
        Creates a new instance of ForwardParameters.
        Parameters:
        af - the ActionForward to append parameters to
      • ForwardParameters

        public ForwardParameters​(java.lang.String path,
                                 boolean redirect)
        Creates a new instance of ForwardParameters with a given path and redirect settings.
        Parameters:
        path - the forward path
        redirect - whether or not forward redirects the client
    • Method Detail

      • addParameter

        public ForwardParameters addParameter​(java.lang.String name,
                                              java.lang.String value)
        Add a parameter to the path.
        Parameters:
        name - the name of the parameter
        value - the value of the parameter
        Returns:
        this ForwardParameters object
      • addAnchor

        public ForwardParameters addAnchor​(java.lang.String newAnchor)
        Add an anchor to the path.
        Parameters:
        newAnchor - anchor name
        Returns:
        this ForwardParameters object
      • forward

        public org.apache.struts.action.ActionForward forward()
        Construct the resulting ActionForward.
        Returns:
        ActionForward with parameters in path