Wednesday, July 12, 2006
Add raw HTML tags on JSF page
Can you put the HTML <div> tag around the JSF tag as below?
<div>
<f:outputText value="Hello, the world!"/>
</div>
Apprently above code won't work. To add raw HTML tags on the JSF page, you need to include the escaped HTML page in the <f:verbatim> JSF tag.
<f:verbatim><div></f:verbatim>
<f:outputText value="Hello, the world!"/>
<f:verbatim></div></f:verbatim>
<div>
<f:outputText value="Hello, the world!"/>
</div>
Apprently above code won't work. To add raw HTML tags on the JSF page, you need to include the escaped HTML page in the <f:verbatim> JSF tag.
<f:verbatim><div></f:verbatim>
<f:outputText value="Hello, the world!"/>
<f:verbatim></div></f:verbatim>
Comments:
<< Home
The following works:
<f:verbatim>
<div class="pageTitle">
</f:verbatim>
<h:outputText value="Hello, the world!"/>
<f:verbatim>
</div>
</f:verbatim>
It generates:
<div class="pageTitle">
Hello, the world!
</div>
Note that it's <h:outputText> not <f:outputText>.
Post a Comment
<f:verbatim>
<div class="pageTitle">
</f:verbatim>
<h:outputText value="Hello, the world!"/>
<f:verbatim>
</div>
</f:verbatim>
It generates:
<div class="pageTitle">
Hello, the world!
</div>
Note that it's <h:outputText> not <f:outputText>.
<< Home