Java Reference
In-Depth Information
Pass-through attributes
HTML5 added several new attributes to existing HTML tags. These new attributes
were not supported by JSF tags. Instead of updating JSF tags to support these new
attributes, the JSF specification team came up with an idea to "future-proof" JSF.
This new idea was pass-through attributes.
Pass-through attributes are attributes that are not interpreted by the JSF API,
but passed-through to the browser to be rendered in the generated HTML. By
incorporating this new feature in JSF 2.2, the JSF specification team immediately
allowed JSF to support all new HTML5 attributes, along with any new attributes
that might be added to HTML in the future.
In the previous section, where we developed a JSF view using HTML5, we used the
new placeholder HTML5 tag. This tag, as its name implies, places some placeholder
text in a text field, giving the user a hint of the format expected for the input. This
is a good example of a tag that was added to HTML5 and can be used in JSF pages
developed using JSF specific tags:
<?xml version='1.0' encoding='UTF-8' ?>
<!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://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:p="http://xmlns.jcp.org/jsf/passthrough">
<h:head>
<title>Registration</title>
<h:outputStylesheet library="css" name="styles.css"/>
</h:head>
<h:body>
<h3>Registration Page</h3>
<h:form>
<h:panelGrid columns="3"
columnClasses="rightalign,leftalign,leftali
gn">
<!-- Additional markup removed since it is not
relevant to the discussion -->
<h:outputLabel value="Email Address:" for="email"/>
<h:inputText id="email" label="Email Address"
required="true"
 
Search WWH ::




Custom Search