Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

choose JavaServer Page tag

Updated on August 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: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

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us