h:headHtmlHead is a UIOutput that renders a
<head>element for webapps, but not for portlets. In the case of portlets, the presence of h:head informs the JSF portlet bridge that JSF resources with
target="head"should be included in the
<head>element rendered by the portal.
General UsageThe usage of h:head 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.
<?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"> <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.1.0 + Showcase Common 3.0.1 + Liferay Faces Util 3.1.0 + Mojarra 2.2.17