This section illustrates you about the JSF outputFormat tag. This tag is used for showing output with the parameterized text that facility allows you to customize the appearance of the text using CSS styles also. This tag value has been parameterized by using the JSF Core param tag what you can learn after some sections, under the outputFormat tag.
Here, an example is also provided for the best illustration about the JSF outputFormat tag. You will seen in the following example that value of the tag is "Hello, {0} !". Following program will show the output like "Hello, chandan !" because "Hello, " already mentioned as the value of the param tag that has been calling in the outputFormat tag by passing parameter like "{0}".
You can show the output text from other resources by mentioning the backing bean value in param tag.
Code Description:
<%@ page contentType="text/html" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<f:view>
<html>
<head><title>jsf h:outputFormat example</title></head>
<body>
<h:outputFormat value="Hello, {0} !">
<f:param value="chandan"/>
</h:outputFormat>
</body>
</html>
</f:view> |
Rendered Output:
This is the image of the rendered output for the above mentioned JSF program when it is run on the browser.

HTML Source Code:
Browser generates html code for your JSF proram like:
<html> <head><title>jsf h:outputFormat example</title></head> <body> Hello, chandan ! </body> </html> |
All attributes of this tag are explained as follows:
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: JSF outputFormat Tag View All Comments
Post your Comment