Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Direct access to a URL  RSS feed

 
Sruthi Sen
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all..

In a web application if i have copied a URL of certain page and pasted in the address bar of another window..first we get authentication form ,and if we give username and password it goes to corresponding servlet or action class depending on the given code..but i need the control goes to the exact jsp or servlet which the URL specifies but not to the Home page as usual.

ie Direct access to a externally pasted URL after logging in successfully but not to the same old homepage.

plzz help me out .

Thank you
Sruthi sen.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Form based authentication should do this for you.
You can store the initial request value in a cookie or the session, and then after login you check for this value and redirect if it exists. Don't forget to remove the item after redirection.

Dave
 
Sruthi Sen
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..

i think this is used if the user's session goes off and if he tries to do something on the page ,it asks for authentication and goes to the exact page where he lost his session...

here it is something like this ..if i have a link to a site or my appliation's page and a user who is not loggedin clicks it ..he should get authenticated and should go the page where the link exactly points to..


correct me if am wrong in understanding your help.

sruthi
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So are you saying you do or you do not want them to login manually before being able to see the page?

If you use Basic Authentication you can include the username/password in the URL, but of course the user would be able to see this.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!