/**
   * Show results.
   *
   * @throws Exception the exception
   */
  protected void showResults() throws Exception {
    FacesContextBroker broker = new FacesContextBroker();
    String dispatchTo = "";
    String tagName = "com.esri.gpt.control.filter.EncodingFilterTag";
    // will prevent going to front page
    this.getRequestContext().addToSession(tagName, "tag");
    HttpServletRequest httpReq = broker.extractHttpServletRequest();
    HttpServletResponse httpResp = broker.extractHttpServletResponse();
    FacesContext fctx = broker.getFacesContext();
    Application application = fctx.getApplication();

    if (this.isResultsOnly()) {
      dispatchTo = SEARCH_RESULTS_PAGE;

    } else {

      // TODO: Glassfish does not support this section (f=searchpage)
      NavigationHandler navHandler = application.getNavigationHandler();
      navHandler.handleNavigation(fctx, null, "catalog.search.results");
      dispatchTo = fctx.getViewRoot().getViewId();

      String jsfSuffix = SearchConfig.getConfiguredInstance().getJsfSuffix();
      if ("".equals(jsfSuffix)) {
        jsfSuffix = ".page";
      }
      if (jsfSuffix.indexOf('.') < 0) {
        jsfSuffix = "." + jsfSuffix;
      }
      // javax.faces.DEFAULT_SUFFIX
      dispatchTo = dispatchTo.replaceAll(".jsp", jsfSuffix);
      // ViewHandler.DEFAULT_SUFFIX_PARAM_NAME = jsfSuffix;
      // fctx.getExternalContext().dispatch(dispatchTo);
      // httpReq.getRequestDispatcher( dispatchTo).forward(httpReq, httpResp);

    }

    // Synching criteria with session criteria in thread so that search result
    // does
    // not have to wait for synch to complete.
    setExtraCriteriaProperties(httpReq);
    SynchSessionCriteria synchSc = new SynchSessionCriteria(criteria, this.readSessionCriteria());
    synchSc.synch();
    // Thread thread = new Thread(synchSc);
    // thread.start();
    jsfDispatchPage(fctx, dispatchTo);
  }