jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes Dynamic link redirect with login Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Dynamic link redirect with login" Watch "Dynamic link redirect with login" New topic

Dynamic link redirect with login

nick angel
Ranch Hand

Joined: Dec 14, 2005
Posts: 39
Good day to all,

I was wondering if someone could give me some guidance to the following matter.

I wish to provide a link to a user to a section of my intranet. If the user is not logged in however
then the user will be redirected to the login page. Once he has successfully logged in the user is
redirected to the original link. (Note: the login mechanism is in a servlet).

I thought of using a session variable that would contain the original link.
If the user is not logged in then the link could be stored as a variable in the user's
session. Once the loggin is successful, the variable could be recovered and used to redirect the user to the
originally requested page. I am simply looking for guidance.

Thank you in advance.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

Sounds like a plan.

[Asking smart questions] [About Bear] [Books by Bear]
ou yang

Joined: Oct 14, 2008
Posts: 10
i know what you mean.you may use filter and session to validate all users.i have some code about this.if you want i can send it to you.
Alexsandra Carvalho
Ranch Hand

Joined: Jul 13, 2007
Posts: 75
Hello ou yang
Please...can you send to me the code about this question?

Thansk a lot
I agree. Here's the link: http://aspose.com/file-tools
subject: Dynamic link redirect with login
It's not a secret anymore!