title: How to customize SPRING_SECURITY_LAST_EXCEPTION.message according to the error I get
body: <p>I made a login system with Spring Security.
  This is my spring-security.xml</p>
  
  <pre><code>... 
  &lt;session-management invalid-session-url="/login"&gt;
         &lt;concurrency-control max-sessions="1" expired-url="/login" error-if-maximum-exceeded="true"/&gt;
  &lt;/session-management&gt;
  
  &lt;form-login 
          login-page="/login"                         
          default-target-url="/index" 
          always-use-default-target="true"
          authentication-failure-url="/login?error=true"          
          username-parameter="j_username"         
          password-parameter="j_password" /&gt;
  
  &lt;logout
          logout-success-url="/login"          
          delete-cookies="JSESSIONID" 
          invalidate-session="true" /&gt;     
      ...
  </code></pre>
  
  <p>Since i have this line    <code>authentication-failure-url="/login?error=true"</code>
  I know that if     <code>error</code> is <code>'true'</code> there's an error: it might be "<strong>bad credentials</strong>" or "<strong>Maximum sessions number exceeded</strong>".But I'd like to know which error really occorred?</p>
  
  <p>Is there a way, inside a java class (@controller), to know what kind of error Spring is giving me, in order to customize those error messages?</p>