title: FacesContext.getCurrentInstance().getExternalContext().redirect does not redirect immediately
body: <p>An <code>Id</code> is passing in as a Url parameter. I try to make sure that the <code>id</code> is an number. If not redirect to the main page</p>
  
  <pre><code>if(facilityId != null){
      try{
          Long.parseLong(facilityId);
      }catch(NumberFormatException e){
          try {
              FacesContext.getCurrentInstance().getExternalContext().redirect("DisplayList.jsf");                    
          } catch (IOException ex) {}
      }
      facility = documentSBean.findFacilityById(Long.parseLong(facilityId));
      ...
  }
  </code></pre>
  
  <p>so if I pass in an id like this</p>
  
  <pre><code>www....?facilityId=3?sdfasfda
  </code></pre>
  
  <p>I catch that <code>3?sdfasfda</code> is not a number, and get to the redirect statement, but it does not redirect right a way, it execute the next couple lines which try to convert <code>3?sdfasfda</code> to a Long, hence yield <code>NumberFormatException</code>. So is there a way to force redirect right away, or is there some other way to solve this problem. Wish that there is an <code>else</code> after a <code>catch</code> :D :D. The above codes are inside my <code>@PostConstruct init()</code> method</p>