Name

<x:choose>

Synopsis

The <x:choose> action controls the processing of nested <x:when> and <x:otherwise> actions. It allows only the first <x:when> action with a test expression that evaluates to true to be processed, or gives the go-ahead to the single <x:otherwise> action if none do.

Syntax

<x:choose>
  <x:when> actions and optionally one <x:otherwise> action
</x:choose>

Attributes

None.

Example

                     <x:choose>
                     <x:when select="category[. = 'General']">
    <td bgcolor="lightgreen">
  </x:when>
                     <x:otherwise>
    <td>
  </x:otherwise>
                     </x:choose>

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.