title: Show div with error message after submit
body: <p>I have simple JSF login form which is redirecting if the user is successfully logged in. I would like not to display only a text if user can't log in, but a div with message. I would like to show that piece of html only if user enters wrong data and could not manage to log in.</p>
  
  <p>How can i manage that? Can you please give me some example, both on form and backing bean with JSF?</p>
  
  <p>I found much examples but only to display text (h:message). Those examples include already some html wrapper tags like div in which that text is wrapped. I would like to display div only if submit fails (it will fail if username/password are wrong).</p>
  
  <p>Let me show this in simple html without JSF data how it looks:</p>
  
  <pre><code>        &lt;div class="error"&gt;Username/password not correct!&lt;/div&gt;
  
          &lt;label for="user_name"&gt;Username:&lt;/label&gt;
          &lt;input name="user_name" type="text" id="user_name" maxlength="20"/&gt;
  
          &lt;label for="password"&gt;Password:&lt;/label&gt;
          &lt;input name="password" type="password" id="password" maxlength="20"/&gt;
  
          &lt;input name="Submit" type="submit" id="log_btn" value="Login" /&gt;
  </code></pre>
  
  <p>So, I hope I am clear enough - I would like not to have that div container when this form is displayed on start, but would like to have that div container when user tries to submit and enters wrong data. I do not want error reports below every input, just that div with my custom single error message to appear.</p>