EGL Reference Guide for iSeries
An EGL pageHandler part (or, more simply, a page
handler) controls a user's run-time interaction with a Web
page. Specifically, the page handler provides data and services to a
JavaServer Page (JSP) that displays the page. You can work most easily
by customizing the JSP file and creating the page handler in the WebSphere
Studio Page Designer; for details, see Page Designer support for
EGL.
The page handler itself includes variables and the following kinds of
logic--
- An OnPageLoad function, which is invoked the first time that the JSP
renders the Web page
- A set of event handler functions, each of which is invoked in response to
a specific user action (specifically, by the user clicking a button or
hypertext link)
- Optionally, validation functions that are used to validate Web-page input
fields
- Private functions that can be invoked only by other page-handler functions
The variables in the page handler are accessed in two ways:
- The run-time environment accesses the data automatically. If a
field in the JSP is bound to an item in the page handler, the
result is as follows--
- After the OnPageLoad function runs and before the Web page is displayed,
each page-handler item value is written to the JSP field to which the data is
bound.
- When the user submits a form in which bound JSP fields reside, the value
in each field of the submitted form is copied to the associated page-handler
item. Only then is control passed to an event handler. (However,
this description does not include the validation steps, which are covered
later in this topic.)
- The event handlers and the OnPageLoad function also can interact with the
data, as well as with data stores (such as SQL databases) and with called
programs.
The pageHandler part should be simple. Although the part might
include light-weight data validations such as range checks, you are advised to
invoke other programs to perform complex business logic. Database
access, for example, should be reserved to a called program.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.