Portal Showcase


c:set becomes useful for setting a value to a JavaBean or an scoped variable.

General Usage

Set value for specifying which value you want to set, and then there are two possible options:
  • Store the value in a scoped variable. Set var and scope attributes for that purpose.
  • Set the value to a JavaBean property. In this case, just use target for the bean name, and property for the bean property name to be set.

Rendered bean value is:true

Source Code

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

	<c:set target="#{jSTLBackingBean}" property="rendered" value="#{true}"/>

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

	<h:outputText value="#{i18n['rendered-bean-value-is']}:#{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 4.0.0 + Liferay Faces Portal 3.0.0 + Showcase Common 3.0.0 + Liferay Faces Util 3.0.0 + Mojarra 2.2.13