title: Show auth error on xhtml login page
body: <p>I have configured authentication using wildfly security-domains. Everything works if credintials are valid. I want to show error message on login.xhtml page when username or password are wrong. How can i do this? I'm using primefaces for pre valdiation(empty fields).</p>
  
  <p>My login.xhtml page:</p>
  
  <pre><code>&lt;h:body
      style="background: url(resources/background.png);   background-repeat: no-repeat; background-attachment: fixed; background-position: center; "&gt;
      &lt;div id="loginDiv" style="margin: 0 auto;"&gt;
          &lt;h:form id="login"
              onsubmit="document.getElementById('login').action='j_security_check';"
              prependId="false"&gt;
  
              &lt;p:growl id="growl" sticky="true" showDetail="true" life="3000" /&gt;
  
              &lt;p:dialog id="loginDial" header="Login page"
                  widgetVar="loginDialog" width="400" height="130" visible="true"
                  closable="false" draggable="false" resizable="false"&gt;
                  &lt;h:panelGrid columns="2" style="margin: 0 auto;"&gt;
                      &lt;p:outputLabel for="j_username" value="Username:" /&gt;
                      &lt;p:inputText id="j_username" name="j_username" required="true" /&gt;
                      &lt;p:outputLabel for="j_password" value="Password:" /&gt;
                      &lt;p:password id="j_password" name="j_password" required="true" /&gt;
                      &lt;p:outputLabel value=" " /&gt;
                      &lt;p:commandButton id="submit" value="Login" ajax="false" /&gt;
                  &lt;/h:panelGrid&gt;
              &lt;/p:dialog&gt;
          &lt;/h:form&gt;
      &lt;/div&gt;
  &lt;/h:body&gt;
  </code></pre>
  
  <p>Do you have any ideas how to show message?</p>
  
  <p>i found something like this:</p>
  
  <pre><code>&lt;login-config&gt;
          &lt;auth-method&gt;FORM&lt;/auth-method&gt;
          &lt;realm-name&gt;LDAPAuth realm&lt;/realm-name&gt;
          &lt;form-login-config&gt;
              &lt;form-login-page&gt;/login.xhtml&lt;/form-login-page&gt;
              &lt;form-error-page&gt;/login.xhtml?failed=true&lt;/form-error-page&gt;
          &lt;/form-login-config&gt;
      &lt;/login-config&gt;
  </code></pre>
  
  <p>But i don't see <code>failed=true</code> in url on failed login :/</p>
  
  <pre><code>FacesContext.getCurrentInstance().isValidationFailed();
  </code></pre>
  
  <p>Return false always.</p>