I am working on a JSF 2.1 application and I noticed some funny code that looks like this:
<h:inputText value="someValue" h:placeholder="Please enter a value" />
Notice that the placeholder is incorrectly prefixed with the JSF html namespace. For some reason this code works and it results in the placeholder attribute being rendered.
I am using the OmniFaces RenderKitFactory, but as you can see below I haven't defined the placeholder attribute on HtmlInputText:
<context-param>
<param-name>org.omnifaces.HTML5_RENDER_KIT_PASSTHROUGH_ATTRIBUTES</param-name>
<param-value>
javax.faces.component.html.HtmlForm=role;
javax.faces.component.html.HtmlInputText=type;
javax.faces.component.html.HtmlInputText=step;
javax.faces.component.html.HtmlInputText=min;
javax.faces.component.html.HtmlInputText=list;
javax.faces.component.html.HtmlInputText=max;
javax.faces.component.html.HtmlInputText=required;
javax.faces.component.html.HtmlCommandButton=data-target;
javax.faces.component.html.HtmlCommandButton=data-toggle;
</param-value>
</context-param>
Why does this work?