Share on Google+Share on Google+

JSF outputText Tag

This is the section in which you can learn more about the tag named outputText tag.

JSF outputText Tag


This is the section in which you can learn more about the tag named outputText tag. This tag is used for creating component for displaying formatted output as text.

Here, you will get an example with complete source code that can be copied in your application for creating a JSF component that show the output of your program.




Code Description:

<%@ page contentType="text/html" %>
<%@ taglib uri="" prefix="h" %>
<%@ taglib uri="" prefix="f" %>

   <head><title>jsf h:message example</title></head>

  <b><h:outputText value="This is the output text." /></b>

Above program shows the output text "This is the output text." that is specified as the value of the JSF HTML tag outputText.

Rendered Result:

HTML Source Code:

     <head><title>jsf h:message example</title></head>

	  <b>This is the output text.</b>

All attributes of the outputText tag are explained as follows:

  • binding: This attribute accepts a value-binding expression linked to a property in a backing bean.
  • converter: This attribute sets a converter instance to be registered for the component. This instance must match the converter-id value of a converter element that is defined in the faces-config.xml file.
  • escape: This attribute sets a boolean flag value that determines if sensitive HTML and XML characters should be escaped in the output generated by the component. It's default value is "true".
  • id: The value of this attribute identifies the component uniquely. So, value of the id attribute must be unique in the closest container.
  • rendered: This attribute sets a boolean flag value that determines the component should be whether or not rendered in the view.
  • style: If you want ot add any CSS with the component then you can put the style as the value of the attribute. Added CSS will be applied on for the component.
  • styleClass: This attribute holds the CSS class name which is defined in the external style sheet.
  • title: This attribute holds a string value that is shown as a tool-tip text of a component or element.
  • value: This attribute sets the current value for the component.



Posted on: June 6, 2007 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Discuss: JSF outputText Tag   View All Comments

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image