The new HTML head (h:head) and body (h:body) tags add HTML type page structure to JavaServer Faces web pages.
The h:head tag represents the head element of a HTML page
The h:body tag represents the body element of a HTML page
The following is an example of a XHTML page using the usual head and body markups:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Add a title</title> </head> <body> Add Content </body>
The following is an example of a XHTML page using h:head and h:body tags:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> <h:head> Add a title </h:head> <h:body> Add Content </h:body>
Both of the above example code segments render the same HTML elements. The head and body tags are mainly useful for resource relocation. For more information on resource relocation see, Resource Relocation using h:output Tags.