Skip to main content

choose JavaServer Page tag

Suggest edit
Updated on March 16, 2022

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:when zzzz1 >
		<!-- HTML or XML code to execute for first when -->
	<pega:when zzzz2 >
		<!-- HTML or XML code to execute for second when -->
		<!-- selected if no previous when tag evaluates to true -->

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

Did you find this content helpful? YesNo

100% found this useful

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best. is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us