title: JSF 2 + Spring 3 + Shiro - Session Timeout doesn't redirect to login page
body: <p>I have this JSF 2.0/Spring app that added Apache Shiro to and a redirect after session timeout never occurs when a user clicks on a command button or triggers an AJAX request.  It does work when they refresh the browser.  This is happening in all browsers.  Here's my applicationContext.xml:</p>
  
  <pre><code>&lt;bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"&gt;
          &lt;property name="securityManager" ref="securityManager" /&gt;
          &lt;property name="loginUrl" value="/index.faces"/&gt;
          &lt;property name="filterChainDefinitions"&gt;
                  &lt;value&gt;
                          /* = authc 
                  &lt;/value&gt;
          &lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"&gt;
          &lt;property name="realm" ref="opacsRealm" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor" /&gt;
  
  &lt;bean id="sha512Matcher" class="org.apache.shiro.authc.credential.HashedCredentialsMatcher"&gt;
  
          &lt;property name="hashAlgorithmName" value="SHA-256" /&gt;
          &lt;property name="hashIterations" value="1024" /&gt;
  &lt;/bean&gt;
  
  
  
  &lt;bean id="opacsRealm" class="org.apache.shiro.realm.jdbc.JdbcRealm"&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
          &lt;property name="authenticationQuery" 
                  value="select PASSWORD, SALT from SEC_USERS where NAME = ?" /&gt;
          &lt;property name="userRolesQuery" 
                  value="SELECT ROLE_NAME FROM SEC_USERS_ROLES WHERE USER_NAME = ?" /&gt;
          &lt;property name="permissionsQuery" 
                  value="SELECT permission FROM SEC_ROLES_PERMISSIONS WHERE ROLE_NAME = ?" /&gt;
          &lt;property name="permissionsLookupEnabled" value="true" /&gt;
          &lt;property name="saltStyle" value="COLUMN" /&gt;
          &lt;property name="credentialsMatcher" ref="sha512Matcher"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Am I doing something wrong in the setup?  The web.xml looks like this:</p>
  
  <pre><code>&lt;filter&gt;
      &lt;filter-name&gt;shiroFilter&lt;/filter-name&gt;
      &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;targetFilterLifecycle&lt;/param-name&gt;
          &lt;param-value&gt;true&lt;/param-value&gt;
      &lt;/init-param&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;shiroFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  &lt;session-config&gt;
    &lt;!-- web.xml expects the session timeout in minutes: --&gt;
    &lt;session-timeout&gt;1&lt;/session-timeout&gt;
  &lt;/session-config&gt;
  </code></pre>