JSF Showcase

h:body

HtmlBody is a UIOutput that renders a <body> element for webapps and a <div> for portlets.

General Usage

The usage of h:body in webapps is the same as with portlets. However, the surrounding tag in a webapp is <html> whereas the surrounding tag in a portlet is f:view.

Source Code

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"
	xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<h:head>
	<title>This is the title of the Facelet page</title>
</h:head>
<h:body>
	<h:outputText value="This is a Facelet page" />
</h:body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<f:view xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html" >
	<h:head />
	<h:body>
		<h:outputText value="This is a Facelet portlet" />
	</h:body>
</f:view>
Liferay Faces Bridge Implementation 4.0.0 + Showcase Common 3.0.0 + Liferay Faces Util 3.0.1-SNAPSHOT + Mojarra 2.2.13