I am working on simple web app using servlet,jsp and el in a MVC pattern approach.
I have a code that tracks current user session in one of my servlets.
I have completed my goal to redirect those users who are not login to the page that tell them to login.
here is the example servlet
What i want is to have the same behavior for those pages that are intended for authenticated users like ones who are login to my website.
Is there a way to separate this code in another class and just call the methods to check if a session is null? or just copy pase this code to all of my servlet.
Thanks in advance.
"Nothing is impossible, impossible takes a little longer".