Name

<ora:menuItem>

Synopsis

The <ora:menuItem> action writes its body contents to the response. If the specified page is the currently requested page, the content is used as is; otherwise it’s embedded in an HTML link element (<a>), using the specified page as the link target and the body contents as the link text. The page value is converted to a server-relative path and URL rewritten, if needed. The intended use for this action is in navigation bars to generate links for all page menu items except for the current page.

Syntax

<ora:menuItem page="pageOrContextRelativePath">
  Menu text for the page
</ora:menuItem>

Attributes

Attribute name

Java type

Dynamic value accepted

Description

page
String

Yes

The page path for the menu item.

Example

<%-- 
  Generate a navigation menu table with two page menu items.
--%>
<table bgcolor="lightblue">
  <tr>
    <td>
      <ora:menuItem page="page1.jsp">
        <b>Page 1</b>
      </ora:menuItem>
    </td>
  </tr>
  <tr>
    <td>
      <ora:menuItem page="page2.jsp">
        <b>Page 2</b>
      </ora:menuItem>
    </td>
  </tr>
</table>

Get JavaServer Pages, 3rd Edition 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.