Form Authentication - Listener
-
03-07-2021 - |
Pregunta
I use FORM-based authentication method in Java JSP/Servlet app. I want to "do something" after a successful login. Is there any listener which help me to do it? I don't want to put any code at the beginning of each page.
Solución
Generally, authentication being a cross-cutting concern, you would have extracted it to an authentication ServletFilter
that is applied to all the servlets that need the user to be authenticated. If you have such a filter, this logic would go into that filter after successful authentication.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow