How to write a custom wiki event listener

See also:

A custom wiki event listener is another JSPWiki extension point, in this case an specialization of a WikiEventListener that allows custom components be aware of all kind of events fired by JSPWiki. You may also be aware of these by registering a normal WikiEventListener, but custom wiki event listeners take care themselves of registering inside JSPWiki, which itself requires some deep knowledge of JSPWiki internals.


Custom Wiki Event Listeners are implemented as SPIs.

Coding a custom wiki event listener is pretty straightforward, just needs two things:

and that's it!

What kinds of events are available?#

There are lots of different types of events. The easiest way to see all them is by inspecting the class and all of its subclasses. The actionPerformed method should take care of downcasting to the appropiate class, if needed, to the appropiate subtype(s) handled by the listener.

Also, each and every of these classes contain a handful of constants that act as event identifiers related to each kind of event, available at WikiEvent#getType(), so you may use this to discern the concrete event for a given WikiEventsubtype.

Unit testing#

See JSPWikiPublicAPI#Testing

Package #


As engine lifecycle extensions are coded as SPIs, JSPWiki is automatically aware about the engine lifecycles extensions present, so there is no need of any further configuration.