0

Hi guys i already looked up at that topic JSF Chrome Save Password on Login form which is very similar to my problem. But the solution doesn't work in my case because I don't use Primefaces. The form looks as following:

<h:form id="loginform" class="form-signin " >

  <h1 class="form-signin-heading  "> <span class="glyphicon glyphicon-user"/> Login Form</h1>
  <h:inputText id="username" value="#{loginHandler.inputUsername}" 
               styleClass="form-control" pt:placeholder="Username" 
               required="true" requiredMessage="Please type in your Username" />
  <h:message style="color: red" for="username"/>
  <br></br>
  <h:inputSecret id="password" value="#{loginHandler.inputPassword}" class="form-control" 
                 pt:placeholder="Password" required="true" pt:type="password"
                 requiredMessage="Please type in your password" />
  <h:message style="color: red" for="password"/>
  <br/>
  <h:commandButton id="loginbutton" action="#{loginHandler.login()}"
                   value="Login" class="btn btn-lg btn-primary btn-block"  />
  <h:message id="loginerror" style="color: red" for="loginbutton"/>

</h:form>

I also used bootstrap but that shouldn't influence the matter right now.
I want that Google saves the Username and password or at least enables it. Because each time i login it doesn't show the possibility of saving the password.
Does anyone have an idea ? Thanks !!

Community
  • 1
  • 1
Zailux
  • 500
  • 5
  • 12
  • Keep in mind that this just renders HTML. Whether or not you use PrimeFaces is mostly inconsequential to this problem. Chrome doesn't know or care which framework you're using. – DavidS Apr 14 '15 at 19:42

2 Answers2

0

I'm using JSF Mojarra 2.1.6 on Glassfish 3.1.2.2, and the following works for me on Google Chrome:

<h:form id="login" >
    <h:inputText id="username"/>
    <h:inputSecret id="password"/>
    <h:commandButton id="loginbutton" action="Admin" />
    <!--  Where "Admin" is just any other page -->
    <h:messages/>
</h:form>
  1. Make "Offer to save web passwords" is enabled Chrome's settings.
  2. Make sure the site isn't an exception in the "Never saved" list.
  3. Make sure your action method redirects to a new page, not the same page.
  4. Test Firefox for good measure.
DavidS
  • 5,022
  • 2
  • 28
  • 55
-1

My first thought is that this problem is specific to your Chrome settings. But in the code you posted, you didn't follow BalusC's advice regarding turning ajax="false".

emerys
  • 66
  • 5