Name

<h:outputText>

Synopsis

This action represents an instance of the component type registered with the type ID javax.faces.HtmlOutputText (by default, an instance of the javax.faces.component.html.HtmlOutputText class), combined with a renderer registered with the renderer type ID javax.faces.Text.

The component is rendered as text, within an HTML <span> element if any of the HTML attributes or the id attribute is set.

Syntax

<h:outputText [id="id"] [binding="componentBinding"] [rendered="true|false"]
  [value="value"] [converter="converter"] [escape="true|false"]
  <!-- HTML attributes -->
  [style="style"] [styleClass="styleClass"] [title="title"]
/>

Attributes

Attribute name

Java type

EL expression type

Description

binding
String

VB

Must be a value binding expression for a property the component is bound to.

converter
String or javax.faces.convert.Converter

VB

If set as a static value, a registered converter ID. If set as a value binding expression, an instance of an object that implements Converter.

escape
boolean

Any

If true, render special HTML and XML characters as character entity codes, e.g., < as &lt;.

id
String

None

The component ID.

rendered
boolean

Any

If set to false, the component isn’t rendered and doesn’t participate in any request processing.

value
Object

No

The component value.

Example

                     <h:outputText value="#{user.name}" />

Get JavaServer Faces now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.