Changes to EGL identifiers in JSP files and generated Java beans
You assign names to page-handler functions, records, and items in accordance with the rules detailed in Naming conventions. However, EGL uses a variation of those names when creating Java identifiers in JSP files and in the Java bean that is derived from a page handler. You need to be aware of those variations if you use the source tab to edit a JSP file, if you use the Properties view, or if you work outside of the EGL-enabled tooling altogether.
The variations are as follows:
- The letters EGL precede the names of the page-handler records, items, and functions. The purpose of this variation is to protect you from errors that could result in the Java run-time environment as a result of differences between the Java bean specification and the naming conventions in EGL.
- In several situations, a suffix is added to the name of a variable that is bound to a particular kind of output control:
- If you bind an item to a Boolean check box, the Java identifier includes the suffix AsBoolean
- If you bind an item to a selection control (a list box, combo box, radio button group, or check box group) and reference the item in the JavaServer Faces selectItems tag, the Java identifier includes the suffix AsSelectItemsList
- If you bind an item to a check box in a JavaServer Faces data table (specifically, if the item is referenced in an inputRowSelect tag), the Java identifier includes the suffix AsIntegerArray
Aside from the variations listed earlier, EGL attempts to create an identifier that exactly matches the name in the page handler.
Consider the page-handler myJSP, which includes variable myIteM. If you bind that variable to a Boolean check box, the JSP file references the Java-bean property myJSP.EGLmyIteMAsBoolean, and the Java-bean getter and setter functions are named as follows:
- getEGLmyIteMAsBoolean
- setEGLmyIteMAsBoolean
The source for the Boolean check-box tag in the JSP file is as follows:
<h:selectBooleanCheckbox styleClass="selectBooleanCheckbox" id="checkbox1" value="#{myJSP.EGLmyIteMAsBoolean}"> </h:selectBooleanCheckbox>EGL avoids generating a name that would not be valid in Java; for details, see How Java names are aliased.
Related concepts
PageHandler part
Related tasks
Creating an EGL data item and associating it with a Faces JSP
Associating an EGL record with a Faces JSP
Using the Quick Edit view for page-handler code
Related reference
How Java names are aliased
Naming conventions
Page Designer support for EGL