The menu context serves to select a menu option, which can be set at runtime in an
action or directly in a JSP-Page. The selected menu option is determined by means
of a path expression.
In the following example, the sub-menu defined in the previous chapter is integrated
through a template (ListSideBar.jsp). If the JSP-Page is called, the menu context is
set and the menu option specified via the path is selected.
<%@ taglib uri="/WEB-INF/tlds/cc-template.tld" prefix="template" %>
<%@ taglib uri="/WEB-INF/tlds/cc-menu.tld" prefix="menu" %>
<menu:ctx path="list/samples/standard/sample101"/>
<template:insert template="/jsp/template/Main.jsp">
<template:put
name="title"
content="User List Common-Controls (Sample101)"
direct="true"/>
<template:put
name="header"
content="/jsp/template/Header.jsp"/>
<template:put
name="sidebar"
content="/jsp/include/ListSideBar.jsp"/>
<template:put
name="about"
content="/jsp/list/sample101/About.jsp"/>
<template:put
name="content"
content="/jsp/list/sample101/UserBrowseContent.jsp"/>
</template:insert>
The result of this is that in all the menus, those menu options are depicted,
which completely fit into the context path:
- In the vertical menu, the following menu option is depicted selected: Menu option "list"
- In the horizontal menu, the following main menu options and sub-manu options are depicted selected
menu group on level 1 "list/samples"
menu group on level 2 "list/samples/standard"
the new group on level 3 "list/samples/standard/sample101"
back |
continue
|