Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FrontController and Servlet Filters

 
Ratheesh Narayanan
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

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.

So what is the possible solution for this???

Please help me in this..

Thanks in advance,

Ratheesh narayanan
 
ak pillai
author
Ranch Hand
Posts: 288
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I could understand this correctly:


why not try:

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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic