Name

<listener>

Synopsis

All the listener types defined by the servlet specification (as opposed to the JSF listener types) must be registered with a <listener> element.

Syntax

<listener>
  [<description [xml:lang="lang"]>description</description>]*
  [<display-name [xml:lang="lang"]>displayName</display-name>]*
  [<icon [xml:lang="lang"]>
     [<small-icon>iconPath</small-icon>]
     [<large-icon>iconPath</large-icon>]
   </icon>]*
  <listener-class>className</listener-class>
</listener>

The <description>, <display-name>, and <icon>, elements can optionally be used, the same as for many other top-level elements. The nested <listener-class> element contains the listener class name:

<listener>
  <listener-class>com.mycomp.AppInitListener</listener-class>
</listener>

Get JavaServer Faces now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.