title: Redirection by Pretty Faces
body: <p>I have come across a problem in which Pretty Faces will result in an infinite loop, ended by my Browser: <code>Firefox has detected that the server is redirecting the request for this address in a way that will never complete.</code></p>
  
  <p><strong>The exact cause of the problem</strong></p>
  
  <p><em>File structure</em></p>
  
  <p><img src="https://i.stack.imgur.com/yTtST.png" alt="enter image description here"></p>
  
  <p><em>pretty-config.xml fragment</em></p>
  
  <pre><code>&lt;url-mapping id="login"&gt;
      &lt;pattern value="/login" /&gt;
      &lt;view-id value="/login/login.xhtml" /&gt;
  &lt;/url-mapping&gt;
  
  &lt;url-mapping id="register"&gt;
      &lt;pattern value="/register" /&gt;
      &lt;view-id value="/login/register.xhtml" /&gt;
  &lt;/url-mapping&gt;
  </code></pre>
  
  <p><strong>Description</strong></p>
  
  <p>Navigation to <code>localhost:8080/register</code> will result in my webpage.
  Navigation to <code>localhost:8080/login</code> will result in the described loop, note that the navigation will result in redirection to <code>localhost:8080/login/</code> &lt;-- a trailing slash.</p>
  
  <p>My guess, <code>localhost:8080/login</code> is a request for the folder <code>login</code>. But I do not know how to fix it, so my request for <code>localhost:8080/login</code> will result in the webpage.</p>
  
  <p>Thanks in advance.</p>