O'Reilly logo

Java EE 7 with GlassFish 4 Application Server by David R. Heffelfinger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JSF 2.2 HTML5 support

HTML 5 is the latest version of the HTML specification. It includes several improvements over the previous version of HTML. JSF 2.2 includes several updates to make JSF pages work nicely with HTML5.

The HTML5-friendly markup

Through the use of pass-through elements, we can develop our pages using HTML 5 tags and also treat them as JSF components. To do this, we need to specify at least one of the element attributes using the http://xmlns.jcp.org/jsf namespace. The following example demonstrates this approach in action:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:jsf="http://xmlns.jcp.org/jsf">      
    <head jsf:id="head">
        <title>JSF Page with HTML5 Markup</title>
 <link jsf:library="css" jsf:name="styles.css" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required