h:outputFormat tag in JSF


The outputFormat tag renders parameterized text and allows you to customize the appearance of this text using CSS styles. Parameterized text is compound text containing placeholder values to be replaced by actual values at rendering time.

also read:

JSP File (index.jsp)

<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
               <h:outputFormat value="Number is {0}.">
                    <f:param value="#{jsfBean.number}" />

JavaBean (JavaBeatJsfBean.java)

package javabeat.jsf;

 * source : www.javabeat.net
public class JavaBeatJsfBean {
    private String number = "10";;

    public String getNumber() {
        return number;

    public void setNumber(String number) {
        this.number = number;
    public String submit()
        return "";


<?xml version='1.0' encoding='UTF-8'?>

<faces-config version="1.2"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">



view in the browser


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Pin It on Pinterest

Share This

Share this post with your friends!

Share This

Share this post with your friends!