title: Apache Shiro doesn't redirect me to login.xhtml in JSF
body: <p>I'm learning <code>Shiro</code> step-by-step with @BalusC's <a href="http://balusc.blogspot.tw/2013/01/apache-shiro-is-it-ready-for-java-ee-6.html" rel="nofollow">article</a>, there is no problem until I <strong>turning it into <em>form based authentication</em></strong> as the <a href="http://balusc.blogspot.tw/2013/01/apache-shiro-is-it-ready-for-java-ee-6.html#FormBasedAuthentication" rel="nofollow">fifth part of the article</a> said.</p>
  
  <p>I did exactly what the article said, but the shiro didn't redirect me to the login page, instead, it always shows <code>index.xhtml</code> whenever I run my web app.  </p>
  
  <p>Here's my code, I have no idea what have I missed.</p>
  
  <p><strong>web.xml</strong>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;org.apache.shiro.web.env.EnvironmentLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;filter&gt;
      &lt;filter-name&gt;shiroFilter&lt;/filter-name&gt;
      &lt;filter-class&gt;org.apache.shiro.web.servlet.ShiroFilter&lt;/filter-class&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;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
      &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
      &lt;dispatcher&gt;INCLUDE&lt;/dispatcher&gt;
      &lt;dispatcher&gt;ERROR&lt;/dispatcher&gt;
  &lt;/filter-mapping&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt;
      &lt;param-value&gt;Development&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;session-config&gt;
      &lt;session-timeout&gt;
          30
      &lt;/session-timeout&gt;
  &lt;/session-config&gt;
  &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;faces/index.xhtml&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>shiro.ini</strong>:</p>
  
  <pre><code>[main]
  authc.loginUrl = /login.xhtml
  
  [users]
  admin = password
  
  [urls]
  /login.xhtml = authc
  /app/** = authc
  </code></pre>
  
  <p>It should have redirect me to the <code>login.xhtml</code>, shouldn't it?<br>
  Any ideas? Thanks in advance.</p>