Spring - 登录后做一些动作

mar*_*osh 5 java spring spring-security

用户登录成功后,我需要在DB中存储实际日期.怎么做 ?过滤器,处理器还是什么?需要帮忙.

fat*_*zzy 6

    public class AuthenticationSuccessHandlerImpl extends SimpleUrlAuthenticationSuccessHandler {
           @Override
       public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) 
       throws IOException, ServletException {
       //your code here    
     }
}
Run Code Online (Sandbox Code Playgroud)

配置:

<beans:bean id="authSuccessHandler"
            class="your.pachage.decleration.AuthenticationSuccessHandlerImpl"/>
Run Code Online (Sandbox Code Playgroud)