Working with <ui:include> and <ui:param>

The <ui:include> and <ui:param> tags are two tag handlers that can be used for accomplishing many kinds of tasks; as long as we keep in mind that tag handlers are efficient only when the view tree is built, we can exploit them for our benefit. For example, we can use them to generate a tree node structure as shown in the following screenshot:

Working with <ui:include> and <ui:param>

In order to accomplish this task, we will spice up the <ui:include> and <ui:param> tags with a dash of JSTL (the <c:if> and <c:forEach> tag handlers) and recursivity.

First, we need a class that represents the abstractization of the tree node concept. Basically, a tree ...

Get Mastering JavaServer Faces 2.2 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.