title: Java EE authentication: how to capture login event?
body: <p>Given an authentication mechanism of type FORM defined for a Java web app, how do you capture the <em>login performed</em> event before being redirected to requested resource? Is there any kind of listener where I can put my code to be executed when a user logs in?</p>
  
  <p>I feel like defining a filter is not the best solution, as the filter is linked to the resource and would be invoked even when the user is already authenticated and asking for a resource. I'm wondering if there's some class/method triggered only by login event.</p>