Package org.apache.wiki.tags

Provides standard JSP tags for JSPWiki.

Package specification

This package contains a diverse set of JSP tags which are used in the template pages.

Managing tag pooling

A typical problem for many tag developers is that many web containers pool tags, i.e. the tag is not released after doEndTag(), but put into a pool, from which it can be invoked again. This is highly efficient, as you don't need to instantiate the tag again.

The problem, however, is that when your tag is put back into the pool, it still retains all the internal references, i.e. none of the member fields are cleared. This means there can be dangling references to things which will take a lot of memory. In JSPWiki's case, the WikiContext is a good example: it can actually contain quite a lot of stuff accumulated during it's life time, and therefore it's important for memory use that all references are cleared.

Unfortunately, the "easy" solution of implementing your custom release handler in Tag.release() does not help, since it is called only when the tag is truly and completely released from the pool. So, as long as the tag sits in the pool, release() is not called, and your references keep on dangling like wet spaghetti off the balcony.

Neither can you trust e.g. doEndTag() being called every time, since e.g. if there is an exception, doEndTag() is never called.

The correct way to do reference cleaning is to implement the TryCatchFinally interface, where the doFinally() method is called every time the tag has been finished with and prior to it being put back into the pool. Most JSPWiki base tag classes IteratorTag and WikiTagBase implement the TryCatchFinally interface, which means that any class subclassed from them also allows has those methods.

Check out the javadocs for the tags for more info!

Related documentation

TBD.