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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top