Forwarding data between web pages

You can use the forward statement to pass data from one web page to another when you transfer control.

See Navigating among web pages with navigation rules for information on forwarding to a different web page.

Follow these steps to pass data between two web pages:
  1. In the page that will receive the data, set the functions defined in the JSF Handler properties onConstructionFunction, onPreRenderFunction, and onPostRenderFunction to receive the parameters, just like any other function would receive parameters.
    For example, the following JSF Handler is set to receive an integer and a character parameter:
    handler myPage type JSFHandler
       {onPreRenderFunction = onPreRender,
        view = "myPage.jsp"}
    
        function onPreRender(myIntVariable int, myCharVariable char(100))
        end
    
    end

    If you define more than one of these JSF Handler properties, the specified functions must have matching parameters because all functions receive the passed data. However, you can leave the parameters out of the functions if you do not plan to use the passed data in that function.

  2. In the page that forwards the data, use a forward statement and include the data in the same order as the functions that will accept it:
    myInteger int = 5;
    myChar    char(100) = "Hello";
    forward myInteger, myChar to "myPage";

    The variables must be separated by commas, and their types must be compatible with the types defined in the functions of the target page.


Feedback