Hi,
I am new to servlets and jsps. I wanted to know what the best design would be for a sample problem I am trying to write code for. Here goes -
I want to create a web site (www.example.com) that just lists the login history of every user (not any functionility any one wants but just an example for the sake of one).
So there are two URLs here - /index.jsp and /login (Lets assume all registrations are done).
The index.jsp will show all the past logins for that user. But for that I have to identify if the user is already logged in or not. If the user is already logged in I show him his history, else I have to forward him to the login page automatically.
I already wrote a custom cryptographically strong cookie that will tell me if the user is logged in or not. So if the cookie is sent to me I can verify if he is authenticated or if the cookie/session has expired or not. That is not a problem.
The design problem I have is this - How should the java class checking for authentication be called? Do I use custom jsp tags for checking this and rewriting the page? I want to make the class easy for my html developers to use when creating new pages. What is the best way to do this?
I guess my question has more to do with the correct usage of java code in jsps and/or may be custom tag libraries. Please feel free to go on as long a rant as you want to :)
Thanks for reading.
- Vas