I'm doing a project using JSP and Servlet. User need to enter their user id and password before they can use my application. In this project, there is number of JSP Pages and Servlets. The access right to thise pages or servlet is based on user access right which is stored in database.
Therefore, before user request to view any pages, I need to verify that the user has log in and determine that the user has the right to view the page. As i said before, user access right is stored in the database.
Is anybody has any idea how to implement this?? I'm thinking to write a function which will do all the verification process, but my problem is how can i call this function from my JSP pages and servlet??