<listener-binding> element

Appears in: <component>

A listener binding is used to create application logic, in the form of a listener (for a DirectLink, ActionLink, Form, etc.) in place within the specification, in a scripting language (such as Jython or JavaScript). The script itself is the wrapped character data for the <listener-binding> element.

When the listener is triggered, the script is executed. Three beans, page, component and cycle are pre-declared.

The page is the page activated by the request. Usually, this is the same as the page which contains the component ... in fact, usually page and compoment are identical.

The component is the component from whose specification the binding was created (that is, not the DirectLink, but the page or component which embeds the DirectLink).

The cycle is the active request cycle, from which service parameters may be obtained.

Figure C.19. <listener-binding> Attributes

NameTypeRequired ?Default ValueDescription
namestringyes The name of the listener parameter to bind.
languagestringno The name of a BSF-supported language that the script is written in. The default, if not specified, is jython.