gpt4 book ai didi

java - 不需要的自动填充

转载 作者:行者123 更新时间:2023-11-29 08:52:18 24 4
gpt4 key购买 nike

我的网络应用程序出现问题。我似乎遇到了自动填写用户名和密码字段的问题。当我登录时没问题,问题是即使在创建帐户页面中它仍然会自动填充,即使我将我的 textFields(InputText) 命名为与其他不同。我在 chrome 和 firefox 上都试过了,还是一样。

以下是应用程序和代码的一些屏幕截图。

创建账户页面

enter image description here

     <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>

对于我的登录

enter image description here

这是我的登录代码:

<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,但是jsf没有autocomplete属性。所以这意味着您必须在每个输入的基础上关闭它或为 UIForm 编写自定义渲染器。

目前有一个 Unresolved 问题,要求将此属性添加到:JSF 规范问题 418。目前,它计划用于 JSF 2.2。

与此同时,您可以使用 OmniFaces Html5RenderKit 在组件上获得对 autocomplete="off"的支持。

关于java - 不需要的自动填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22172036/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com