我试图跳过浏览器提示以保存我的登录表单的密码.
我已经检查了这个问题,并添加了autocomplete ="off"属性(在表单和字段上).
只需导航到另一个页面就可以了.但是,当我使用?faces-redirect=true(在我的主页按钮)时,我得到提示.
admin.xhtml:
<h:form id="form" autocomplete="off">
<p:growl id="growl" showDetail="true" sticky="false" life="3000" />
<p:layout fullPage="true">
<p:layoutUnit position="center" >
<p:panel id="loginPanel" visible="#{not admin.loggedIn}">
<h:panelGrid columns="2" cellpadding="5">
<f:facet name="header">
<h:outputLabel value="Administration" />
</f:facet>
<h:outputLabel for="username" value="Username:" />
<p:inputText id="username" value="#{admin.username}" required="true" autocomplete="off" label="username" />
<h:outputLabel for="password" value="Password:" />
<p:password id="password" value="#{admin.password}" required="true" autocomplete="off" label="password" />
<f:facet name="footer">
<p:commandButton value="Login" update="growl loginPanel logoutPanel"
process="loginPanel" actionListener="#{admin.login}" />
</f:facet>
</h:panelGrid>
</p:panel>
</p:layoutUnit>
<p:layoutUnit position="north" size="85">
<p:panel id="logoutPanel">
<p:commandButton …Run Code Online (Sandbox Code Playgroud)