我在我的web應用程序中遇到問題。我似乎在我的用戶名和密碼字段中遇到了自動填充。沒問題,當我登錄時,即使在我的textFields(InputText)命名方式不同的情況下,即使在創建帳戶頁面中,它仍然會自動填充。我已經在Chrome和Firefox中嘗試了這一點,它仍然是一樣的。不需要的自動填充
下面是應用程序和代碼的一些屏幕截圖。
對於創建賬戶頁面
<p:outputLabel id="userLabel" value="Username*" />
<p:inputText id="userField"
value="#{marketingPersonController.marketingPerson.account.username}"
required="true" requiredMessage="Username* value is required."
label="UsernameInput">
<f:ajax
listener="#{marketingPersonController.checkUsernameIfAvailable()}"/>
</p:inputText>
<p:outputLabel id="passLabel" value="Password*"/>
<p:password id="passField"
value="#{marketingPersonController.marketingPerson.account.password}"
feedback="true" inline="true"
match="confirmPassField" required="true"
requiredMessage="Password* value is required" label="PasswordInput"
validatorMessage="Password must be at least 6 characters/Password does not match">
<f:validateLength minimum="6" />
</p:password>
對於我的日誌中
這裏是我的日誌代碼:
<table>
<tr>
<td><p:outputLabel rendered ="#{!accountController.loggedIn}" value ="Username:"/></td>
<td><p:inputText rendered="#{!accountController.loggedIn}" id="username" value="#{accountController.account.username}"/></td>
<td><p:message for="username" rendered ="false"/></td>
</tr>
<tr>
<td><p:outputLabel rendered="#{!accountController.loggedIn}" value="Password:"/></td>
<td><p:password rendered="#{!accountController.loggedIn}" id="password" value="#{accountController.account.password}"/></td>
<td><p:message for="password" rendered ="false"/></td>
</tr>
請參閱[autocomplete =「off」相關問題](http://stackoverflow.com/questions/3211442/how-to-do-autocomplete-off-at-form-level-in-jsf) –