title: Unable to find matching navigation case with from-view-id '/login.xhtml' for action '#{admin.Validity}' with outcome 'failure'
body: <p>I can't get it to work. i get the following:</p>
  
  <pre><code>Unable to find matching navigation case with from-view-id '/login.xhtml' for action '#{admin.Validity}' with outcome 'failure'
  </code></pre>
  
  <p>this is the code i'm using:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="main" &gt;
  
          &lt;h:form id="login_form"&gt;
              &lt;table&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;h:outputText value="User: " /&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;h:inputText id="username"
                              value="#{admin.username}" /&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;h:outputText value="Password: " /&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;h:inputSecret id="password"
                              value="#{admin.password}" /&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;h:commandButton value="Login" type="submit"
                              action="#{admin.Validity}" /&gt;&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/h:form&gt;
  
      &lt;/div&gt;
  </code></pre>
  
  <p>Admin.java</p>
  
  <pre><code>import java.io.Serializable;
  import javax.faces.bean.ManagedBean;
  import javax.faces.bean.SessionScoped;
  
  
  @ManagedBean(name="admin")
  @SessionScoped
  public class Admin implements Serializable {
  /**
   * 
   */
  private static final long serialVersionUID = 1L;
  Boolean authenticated;
  String username;
  String password;
  
  public String getUsername() {
      return username;
  }
  public void setUsername(String username) {
      this.username = username;
  }
  public String getPassword() {
      return password;
  }
  public void setPassword(String password) {
      this.password = password;
  }
  
  public String Validity() {
      if(username.equals("admin") &amp;&amp; password.equals("admin")) {
          authenticated=true;
          return "success";
      }   else   {
          authenticated=false;
          return "failure";
      }
  }
  
  }
  </code></pre>
  
  <p>faces-config.xml</p>
  
  <pre><code>&lt;faces-config
      xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
      version="2.0"&gt;
  
  &lt;navigation-rule&gt;
      &lt;from-view-id&gt;/login.xhtml&lt;/from-view-id&gt;
  
      &lt;navigation-case&gt;
         &lt;from-action&gt;#{Admin.Validity}&lt;/from-action&gt;
         &lt;from-outcome&gt;success&lt;/from-outcome&gt;
         &lt;to-view-id&gt;/main.xhtml&lt;/to-view-id&gt;
         &lt;redirect/&gt;
      &lt;/navigation-case&gt;
  
      &lt;navigation-case&gt;
          &lt;from-action&gt;#{Admin.Validity}&lt;/from-action&gt;
          &lt;from-outcome&gt;failure&lt;/from-outcome&gt;
          &lt;to-view-id&gt;/login.xhtml&lt;/to-view-id&gt;
      &lt;/navigation-case&gt;
  &lt;/navigation-rule&gt;
  &lt;/faces-config&gt;
  </code></pre>
  
  <p>thank you. 
  Y</p>