forward

The EGL forward statement is used primarily to display a Web page with variable information, but can access a URL or can invoke a servlet or Java™ program that runs in the Web application server.

The statement acts as follows:
  1. Commits recoverable resources, closes files, and releases locks
  2. Forwards control
  3. Ends the code that runs the forward statement

The syntax diagram is as follows:


Syntax diagram for the forward statement, without a UI record
argument
An item or record that is passed to the code being invoked. The names of an argument and its corresponding parameter must be the same in all cases. You may not pass literals.

If you are invoking a PageHandler, the arguments must be compatible with the parameters specified for the onPageLoad function of the PageHandler. The function (if any) may have any valid name and is referenced by the PageHandler property OnPageLoadFunction. If you are invoking a program, the arguments must be compatible with the program parameters.

The following details may be of interest, depending on how you are using the technology:
  • The argument must be named the same as the corresponding parameter because the name is used as a key in storing and retrieving the argument value on the Web application server.
  • Instead of passing an argument, the invoker can do as follows before invoking the forward statement:
    • Place a value in the request block by invoking the system function J2EELib.setRequestAttr; or
    • Place a value in the session block by invoking the system function J2EELib.setSessionAttr.
    In this case, the receiver does not receive the value as an argument, but by invoking the appropriate system function:
    • J2EELib.getRequestAttr (to access data from the request block); or
    • J2EELib.getSessionAttr (to access data from the session block).
  • A character item is passed as an object of type Java String.
  • A record is passed as a Java Bean.
to label targetID
Specifies a Java Server Faces (JSF) label, which identifies a mapping in a runtime JSF-based configuration file. The mapping in turn identifies the object to invoke, whether a JSP (usually one associated with an EGL PageHandler), an EGL program, a non-EGL program, or a servlet. The word label is optional, and targetID is a quoted string.
to URLtargetID
Specifies a URL and (if needed) a string of values used by the invoked PageHandler, VGWebTransaction program, or servlet.

Related tasks
Forwarding control between pageHandlers and Web transactions

Related reference
Function invocations
getRequestAttr()
getSessionAttr()
transferName

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.