The JSF runtime includes c:choose implementation of the JSTL <c:choose> JSP tag. If JSTL sounds familiar (heavily used in JSP) then, it provides the same features for JSF too.

General Usage

Use together with c:when and c:otherwise to choose which portion of code will be rendered depending in a condition that can be set in test attribute from c:when tag handler.

Source Code

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"

		<c:when test="#{jSTLBackingBean.rendered}">

public class JSTLBackingBean {

	private boolean rendered;

	public boolean isRendered() {
		return rendered;

	public void setRendered(boolean rendered) {
		this.rendered = rendered;

	public void toggleRendered(ActionEvent event) {
		this.rendered = !rendered;

Liferay Faces Bridge Implementation 5.0.0 + Showcase Common 3.1.1 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20