choose JavaServer Page tag

Use the choose JSP tag to select at most one enclosed branch of when tags.

Include one or more when tags and a final otherwise tag within the scope of the choose tag.

  • If none of the when tags evaluate to true, HTML or XML text within the otherwise tag is processed.
  • For the first of the when tags that evaluates to true, HTML or XML text within that when tag is processed. Subsequent stream processing continues after the close of the choose tag.

The choose tag has no attributes. For example:

<pega:choose>
	<pega:when zzzz1 >
		<!-- HTML or XML code to execute for first when -->
	</pega:when>
	<pega:when zzzz2 >
		<!-- HTML or XML code to execute for second when -->
	</pega:when>
	<pega:otherwise>
		<!-- selected if no previous when tag evaluates to true -->
	</pega:otherwise>
</pega:choose>

where zzzz1 and zzzz2 are a name=, test=, or other valid set of when JSP tag attributes.

You can nest when tags within when tags. You can't use JSP tags other than when and otherwise within the scope of a choose tag.

JavaServer Page tags