title: ajax redirect not working
body: <p>This is my jsf code :-</p>
  
  <pre><code>  &lt;h:commandButton id="cmdLogin" value="Login" actionListener="#{indexBean.login}"&gt;
                              &lt;f:ajax execute="@form" render="@all" /&gt;
                          &lt;/h:commandButton&gt;
  </code></pre>
  
  <p>This is my login method of indexBean :-</p>
  
  <pre><code> public void login(){
  
                  HttpServletResponse objHttpServletResponse = (HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
                  objHttpServletResponse.sendRedirect("Restricted/Home.jsf");
  
      }
  </code></pre>
  
  <p>I get one alert in javascript <code>emptyResponse: An empty response was received from the server.  Check server error logs.</code>. Why does this type of redirect not work?</p>
  
  <p><strong>EDIT :-</strong>
  Interestingly, when i redirect from faces-config.xml, it works!</p>
  
  <pre><code>&lt;faces-config version="2.0"
      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"&gt;
  
      &lt;navigation-rule&gt;
          &lt;from-view-id&gt;/index.xhtml&lt;/from-view-id&gt;
          &lt;navigation-case&gt;
              &lt;from-outcome&gt;Home&lt;/from-outcome&gt;
              &lt;to-view-id&gt;/Restricted/Home.jsf&lt;/to-view-id&gt;
              &lt;redirect/&gt;
          &lt;/navigation-case&gt;
      &lt;/navigation-rule&gt;
  
  &lt;/faces-config&gt;
  </code></pre>
  
  <p>And obviously, i changed <code>actionListener</code> of commandbutton to <code>action</code> and changed return type of <code>login</code> to <code>String</code> and returned <code>home</code> from login method. Can anybody tell now, if this is the desired behaviour in JSF ? How come redirect  from <code>faces-config.xml</code> works and simple redirect in managedbean doesn't?</p>