max*_*mus 7 html css java jsf primefaces
我想创建一个landingPage,我想通过jsf 2.0和Primefaces 3.5将数据保存在我的数据库中
我的页面*.xhtml页面如下所示:

但是,我想让它看起来像我的HTML页面:

除了CSS我的h:inputText应该包含一个占位符.我的代码看起来像这样:
<h:form class="homepage_invitee_form" action="" method="POST">
<h:inputText name="email" placeholder="Email Address"
id="email_address_new" type="text placeholder" />
<br />
<h:inputText name="firstName" placeholder="First Name"
id="firstname_new" type="text placeholder" />
<h:inputText name="lastName" placeholder="Last Name"
id="lastname_new" type="text placeholder" />
<br />
<h:button value="Request Invitation" type="submit" class="btn btn-primary opal_btn"
id="submit_form_new" />
</h:form>
Run Code Online (Sandbox Code Playgroud)
如您所见,占位符属性未呈现.我真的很感激如何正确地渲染它.
UPDATE
我的HTML代码如下所示:
<form class="homepage_invitee_form" action="" method="POST">
<input name="email" placeholder="Email Address" id="email_address_new" type="text placeholder"><br>
<input name="firstName" placeholder="First Name" id="firstname_new" type="text placeholder">
<input name="lastName" placeholder="Last Name" id="lastname_new" type="text placeholder"><br>
<button type="submit" class="btn btn-primary opal_btn" id="submit_form_new">Request Invitation</button>
</form>
Run Code Online (Sandbox Code Playgroud)
对于JSF 2.2(JEE 7),您可以使用命名空间
xmlns:p="http://xmlns.jcp.org/jsf/passthrough"
然后使用它,例如:
<h:inputText value="#{bean.field}" p:placeholder="supply value"/>
这将它传递给生成的HTML(NB:HTML 5属性).
请参阅http://www.adam-bien.com/roller/abien/entry/jsf_2_2_and_html.