title: How to use <h:commandButton action="#{method here}" />?
body: <p>I'm willing to call a method like this :</p>
  
  <pre><code>&lt;h:commandButton value="Register" action="#{account.action}"/&gt;
  </code></pre>
  
  <p>With a class like follow :</p>
  
  <pre><code>package com.sources;
  
  public class Account {
      private String password1;
      private String password2;
  
      public String getPassword1() {
          return password1;
      }
  
      public void setPassword1(final String password1) {
          this.password1 = password1;
      }
  
      public String getPassword2() {
          return password2;
      }
  
      public void setPassword2(final String password2) {
          this.password2 = password2;
      }
  
      public void action() {
          //if the passwords matchs
              //change page
          //else
              //display an error on the xhtml page
      }
  }
  </code></pre>
  
  <p>In the method, I would like to change the page or display an error, depending on the validity of the registration.</p>
  
  <p>The action to change the page would be the same as follow, but called in the method <code>#{account.action}</code> :</p>
  
  <pre><code>&lt;h:commandButton value="Register" action="connect"/&gt;
  </code></pre>