title: j_security_check not redirecting to angular with # hash key
body: <p>I have a jboss web application with form-based authentication and Angular based client.
  Scenario:</p>
  
  <ol>
  <li>I go to <a href="http://localhost:8082/my-app/#/dashboard" rel="nofollow">http://localhost:8082/my-app/#/dashboard</a>, with session timed out</li>
  <li>It redirects to login page (login.jsp). I enter the username and password, and submit.</li>
  <li>It sends me to localhost:8080/my-app, <strong>not</strong> <a href="http://localhost:8082/my-app/#/dashboard" rel="nofollow">http://localhost:8082/my-app/#/dashboard</a></li>
  </ol>
  
  <p>j_security_check is supposed to return the requested url after successful login. but does it ignore the # suffix?</p>
  
  <p><strong>login.jsp</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;form id="loginForm" method="post" action="/my-app/j_security_check"&gt;
            &lt;input id="usernameInput" name="j_username" type="hidden" /&gt;
             &lt;input id="password" name="j_password" type="password" required=""&gt;
             &lt;button type="submit"&gt;
                  Sign In
                &lt;/button&gt;
            &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
           version="2.4"&gt;
  
    &lt;display-name&gt;OpTierUI Application &lt;/display-name&gt;
    &lt;security-constraint&gt;
      &lt;web-resource-collection&gt;
        &lt;web-resource-name&gt;CSS&lt;/web-resource-name&gt;
        &lt;url-pattern&gt;/styles/*&lt;/url-pattern&gt;
        &lt;url-pattern&gt;/fonts/*&lt;/url-pattern&gt;
        &lt;url-pattern&gt;/assets/images/*&lt;/url-pattern&gt;
      &lt;/web-resource-collection&gt;
    &lt;/security-constraint&gt;
    &lt;security-constraint&gt;
      &lt;web-resource-collection&gt;
        &lt;web-resource-name&gt;Protected Area&lt;/web-resource-name&gt;
        &lt;description&gt;These pages are only accessible by authorized administrators.&lt;/description&gt;
        &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/web-resource-collection&gt;
    &lt;/security-constraint&gt;
    &lt;login-config&gt;
      &lt;auth-method&gt;FORM&lt;/auth-method&gt;
      &lt;form-login-config&gt;
        &lt;form-login-page&gt;/login.jsp&lt;/form-login-page&gt;
        &lt;form-error-page&gt;/login.jsp?error=error&lt;/form-error-page&gt;
      &lt;/form-login-config&gt;
    &lt;/login-config&gt;
    &lt;error-page&gt;
      &lt;error-code&gt;403&lt;/error-code&gt;
      &lt;location&gt;/login.jsp?unauthorized=unauthorized&lt;/location&gt;
    &lt;/error-page&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>