title: Unable to find matching navigation case with from-view-id '/index.xhtml' for action : JSF
body: <p>I am getting the following error : 
  Unable to find matching navigation case with from-view-id '/index.xhtml' for action '#{medcontroller.getMedGeneric}' with outcome 'javax.faces.model.ListDataModel@7a652236'</p>
  
  <p>I am new to jsf and I'm really clueless about solving this error. I have a ManagedBean with the following code:</p>
  
  <p>MedController.java</p>
  
  <pre><code>@ManagedBean(name = "medcontroller")
  @SessionScoped
  
  public class MedController implements Serializable {
      int startId;
      String gName;
      int endId;
      DataModel medNames;
      //DataModel medGeneric;
      MedicineHelper helper;
      private int recordCount = 1000;
      private int pageSize = 10;
      private Medicine current;
      private int selectedItemIndex;
  
      public MedController() {
          helper = new MedicineHelper();
          startId = 1;
          endId = 10;
      }
  
      public MedController(int startId, int endId) {
          helper = new MedicineHelper();
          this.startId = startId;
          this.endId = endId;
      }
  
      public Medicine getSelected() {
          if (current == null) {
              current = new Medicine();
              selectedItemIndex = -1;
          }
          return current;
      }
  
      public DataModel getMedNames() {
          if (medNames == null) {
              medNames = new ListDataModel(helper.getMedNames(startId, endId));
          }
          return medNames;
      }
  
      public String getgName()
          {
          return gName;
      }
  
      public void setgName(String gName)
          {
          this.gName = gName;
      }
  
      public DataModel getMedGeneric() {
          if (medNames == null) {
              medNames= new ListDataModel(helper.getMedGeneric(gName));
          }
          return medNames;
      }
  
      void recreateModel() {
          medNames = null;
      }
  
      public boolean isHasNextPage() {
          if (endId + pageSize &lt;= recordCount) {
              return true;
          }
          return false;
      }
  
      public boolean isHasPreviousPage() {
          if (startId-pageSize &gt; 0) {
              return true;
          }
          return false;
      }
  
      public String next() {
          startId = endId+1;
          endId = endId + pageSize;
          recreateModel();
          return "index";
      }
  
      public String previous() {
          startId = startId - pageSize;
          endId = endId - pageSize;
          recreateModel();
          return "index";
      }
  
      public int getPageSize() {
          return pageSize;
      }
  
     public String prepareView(){
          current = (Medicine) getMedNames().getRowData();
          return "browse";
      }
     public String prepareList(){
          recreateModel();
          return "index";
      }
  
  }
  </code></pre>
  
  <p>And here is my JSF file</p>
  
  <p>index.xhtml</p>
  
  <pre><code>&lt;ui:define name="body"&gt;
      &lt;h:form styleClass="jsfcrud_list_form"&gt;
      &lt;h:commandLink action="#{medcontroller.previous}" value="Previous #{medcontroller.pageSize}" rendered="#{medcontroller.hasPreviousPage}"/&gt; 
      &lt;h:commandLink action="#{medcontroller.next}" value="Next #{medcontroller.pageSize}" rendered="#{medcontroller.hasNextPage}"/&gt; 
      &lt;h:dataTable value="#{medcontroller.medNames}" var="item" border="1" cellpadding="15" cellspacing="10" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px"&gt;
      &lt;h:column&gt;
          &lt;f:facet name="header"&gt;
              &lt;h:outputText value="BrandName"/&gt;
          &lt;/f:facet&gt;
              &lt;h:outputText value="#{item.brandName}"/&gt;
      &lt;/h:column&gt;
      &lt;h:column&gt;
          &lt;f:facet name="header"&gt;
              &lt;h:outputText value="Generic"/&gt;
          &lt;/f:facet&gt;
              &lt;h:outputText value="#{item.generic}"/&gt;
      &lt;/h:column&gt;
      &lt;h:column&gt;
          &lt;f:facet name="header"&gt;
              &lt;h:outputText value=" "/&gt;
          &lt;/f:facet&gt;
              &lt;h:commandLink action="#{medcontroller.prepareView}" value="View"/&gt;
      &lt;/h:column&gt;
      &lt;/h:dataTable&gt;
  
      &lt;h:inputText value="#{medcontroller.gName}" /&gt;
      &lt;h:commandButton value="Submit" action="#{medcontroller.getMedGeneric}" /&gt;
      &lt;/h:form&gt;
  &lt;/ui:define&gt;
  </code></pre>
  
  <p>Please help me solve the error.
  Also, I do not have a faces-config.xml file. I am using netbeans ide 7.1.2 web application with jsf and hibernate framework. </p>
  
  <p>Thank you in advance.</p>