title: spring security login always get access denied
body: <p>I'm trying to learn spring security, so I've downloaded some sample project and then I tried to implement that solution to my project.But when I try to submit login form, I always get 403 page which is defined in applicationContext-security.xml. But I expected is 'authentication-failure-url' for invalid username/pwd, or 'default-target-url' for correct username/pwd rather than 'access-denied-handler' /forbidden(my 403 page).  I'd be really thankful, if somebody, who is more experienced, could help me.
  application-Security.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;security:http security="none" pattern="/public/**"/&gt;
  &lt;security:http security="none" pattern="/login*"/&gt;
  &lt;security:http security="none" pattern="/maxSessionError*"/&gt;
  &lt;security:http security="none" pattern="/forbidden*"/&gt;
  &lt;security:http use-expressions="true"&gt;
      &lt;security:intercept-url pattern="/**" access="isAuthenticated()"/&gt;
      &lt;security:form-login login-page="/login"
                           default-target-url="/home"
                           authentication-failure-url="/login"
                           authentication-success-handler-ref="loginSuccessHandler"
      /&gt;
      &lt;security:logout  invalidate-session="true"  delete-cookies="true" success-handler-ref="logoutSuccessHandler" /&gt;
      &lt;security:access-denied-handler error-page="/forbidden"/&gt;
      &lt;security:session-management session-fixation-protection="newSession" &gt;
          &lt;security:concurrency-control max-sessions="1" error-if-maximum-exceeded="false"  expired-url="/maxSessionError" /&gt;
      &lt;/security:session-management&gt;
  
      &lt;security:custom-filter ref="xunxiSecurityInterceptor" before="FILTER_SECURITY_INTERCEPTOR" /&gt;
  &lt;/security:http&gt;
  </code></pre>
  
  <p>login.jsp</p>
  
  <pre><code>&lt;form action="&lt;%=request.getContextPath()%&gt;/j_spring_security_check" method="post" class="login-form"  id="login-form" &gt;
          &lt;label&gt;Username&lt;/label&gt;
          &lt;input type="text" placeholder="username" name="j_username"/&gt;
          &lt;label&gt;Password&lt;/label&gt;
          &lt;input type="password" placeholder="password" name="j_password"/&gt;
          &lt;label&gt;
          &lt;input type="checkbox" name="_spring_security_remember_me" /&gt; Remember me &lt;/label&gt;
          &lt;button type="submit" &gt;
              Login
          &lt;/button&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>