This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The problem which I am facing is slightly complex.
I have jsp page having many hyperlinks which request to a common Servlet (Front Controller). When the user clicks on a hyperlink the request forwards through another Servlet(Intercepting Filter). This Servlet checks whether the user has authenticated. If the user is not authenticated it shows a login page else the page which the user requested.
But the problem here is, once after the user authenticated from login page, he has to see the page which he had requested.
1. Extract the requested URL from the request object (e.g. req.getRequestURL).
2. if already logged in then forward to to requested URL.
4. If not logged in then store the requested URL in the seesion, a hidden field,as query string or as a cookie and forward the user to the Login page.
5. If a session, hidden field or query string value exist for the requested URL, then forward (if no bookmark required)/sendRedirect (if bookmarking required) to the requested URL value stored in your session/hidden field. otherwise forward to your home page.
[ July 07, 2006: Message edited by: ak pillai ]
[ July 07, 2006: Message edited by: ak pillai ] [ July 07, 2006: Message edited by: ak pillai ]