问题
How do I get my JSF login page to prompt Chrome to save password?
<h:form id="login-form" class="form login-form">
<h:outputLabel for="j_username" value="Email:" />
<p:inputText value="#{loginBean.j_username}" id="j_username"
required="true">
</p:inputText>
<h:outputLabel for="j_password" value="Password:" />
<h:inputSecret value="#{loginBean.j_password}" id="j_password"
required="true">
<p:commandButton id="loginButton"
value="Login" action="#{loginBean.login}" />
</h:form>
回答1:
Turn off ajax by ajax="false" on the <p:commandButton>. For security reasons, Chrome won't save passwords of ajax login forms.
If that also doesn't help, then go to Settings > Show advanced settings > Manage saved passwords (or go to chrome://settings/passwords in Chrome) and scroll to the very bottom of the list to see if the site in question isn't accidently covered by "Never saved" list.
来源:https://stackoverflow.com/questions/16604099/jsf-chrome-save-password-on-login-form