I would like to use the new HTML5 <input type="date">
and bind its value to a managed bean:
<input type="date" value="#{bean.date}"/>
How can I achieve this?
This is only possible since JSF 2.2. This feature is known as "passthrough elements".
<html xmlns:jsf="http://xmlns.jcp.org/jsf">
...
<input type="date" jsf:value="#{bean.date}" />
Alternatively, use "passthrough attributes".
<html xmlns:a="http://xmlns.jcp.org/jsf/passthrough">
...
<h:inputText a:type="date" value="#{bean.date}" />
In older JSF versions, use a custom component and/or renderer. You can find links to examples in Custom HTML tag attributes are not rendered by JSF.