title: An explanation about overriding SimpleUrlAuthenticationFailureHandler
body: <p>I've been studying java and Spring for a while, during my spare time so I neither master java nor Spring yet.</p>
  
  <p>For the web project I created to study java and Spring I had to extends the <code>SimpleUrlAuthenticationFailureHandlerm</code>.</p>
  
  <p>What it's not clear to it's why after extending <code>SimpleUrlAuthenticationFailureHandler</code> and overriding <code>onAuthenticationFailure</code>, in my own <code>onAuthenticationFailure()...</code> method I had to call the <code>super.onAuthenticationFailure(...)</code>  method.</p>
  
  <p>Probably I didn't get one of the main rule of java.</p>
  
  <p>Here is the class i was talking about</p>
  
  <pre><code>public class CustomAuthenticationFailureHandler extends SimpleUrlAuthenticationFailureHandler { 
  
      @Override
      public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws IOException, ServletException {    
  
         if(exception.getClass().isAssignableFrom(BadCredentialsException.class)) {
                setDefaultFailureUrl("/url1");
          }
  
         else if (exception.getClass().isAssignableFrom(DisabledException.class)) {        
              setDefaultFailureUrl("/url2");
         }
  
         else if (exception.getClass().isAssignableFrom(SessionAuthenticationException.class)) {      
              setDefaultFailureUrl("/url3");  
        }
  
        super.onAuthenticationFailure(request, response, exception);  //why this???
      }    
  }
  </code></pre>