forward
The EGL forward statement is invoked from a page handler or from an EGL program. The primary purpose is to display a Web page with variable information; but the statement also can invoke a servlet or Java program that runs in the Web application server.
The statement acts as follows:
- Commits recoverable resources, closes files, and releases locks
- Forwards control
- Ends the code that runs the forward statement
The syntax diagram is as follows:
- 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.
Various restrictions are in effect:
- If you are invoking a page handler, the arguments must be compatible with the parameters specified for the onPageLoad function of the page handler. The function (if any) may have any valid name and is referenced by the page handler property OnPageLoad.
- 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 sysLib.setRequestAttr; or
- Place a value in the session block by invoking the system function sysLib.setSessionAttr.
In this case, the receiver does not receive the value as an argument, but by invoking the appropriate system function:
- sysLib.getRequestAttr (to access data from the request block); or
- sysLib.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 run-time JSF-based configuration file. The mapping in turn identifies the object to invoke, whether a JSP (usually one associated with an EGL page handler), an EGL program, a non-EGL program, or a servlet. The word label is optional, and targetID is a quoted string.
Related reference
Function invocations
sysLib.getRequestAttr
sysLib.getSessionAttr
sysVar.transferName