The Common-Controls Tag Library


Sets the menu context directly in the JSP-Page.

The application has exactly one menu context per user session. This specifies which menu option is currently active. This is done by defining the current menu context path.

The menu context can, with this tag, be directly specified in a JSP-Page, or it is set, in the application, before the call to the JSP-Page with the method

The menu context acts on the depiction of all menu context elements.

Tag class: ContextTag

[ Syntax ]

Standard Syntax
[ filter = "String" ]
[ path = "String" ]

[ Attributes ]

filterString Sets the current menu context filter.

Every menu option can be optionally fitted with a filter list. Menu options are only displayed if they:

  • do not have a filter list.
  • have a filter list and the context filter is present in its entirety as a character string in this list.
The context filter can also be set in the application with the help of the method

pathString Defines the current menu context path. The context path defines which menu entry is selected.

There is a hierarchical menu path assigned to every menu element (menu or menu option). It is determined across the menu hierarchy by concatenation of the menu IDs.

A menu element should be considered to be selected when the context path starts with its menu path.

The Id of a menu is admin/tools and the current context path is set to admin/tools/dbquery .

  • The entire menu is then considered to be selected.
  • A lower-level menu option with the id dbquery would now be depicted as an active menu option since its complete menu path admin/tools/dbquery fits in the context path.
  • The lower-level menu option with the id sessionlist would be depicted as an unselected menu option, since ist complete menu path admin/tools/sessionlist does not fit in the context path.

Annotation: The individual path elements are delimited with "/".


[ Example ]

Sets the menu context of the current page and selects the menu option admin/tools/dbquery.

<%@ taglib uri=""  prefix="menu" %>

<menu:ctx path="admin/tools/dbquery" filter=""/>