File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

going back

 
Sarathy Srinivas
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a problem with page redirection. On my site I have a page that can be reached through several other pages (change profile page). This page has several options changemail id, password .. etc. I need to find a way to redirect to the page where the change profile link was clicked .. i.e back to that page. (as a link or button, doesnt matter). Under normal circumstances i would be able to do this with the history.go(x) but as i cant predict how many pages back since the user can do many form submissions and redirections from the cahnge profile page. So, is there anyway to store the value of the previous page the moment i come to the change profile page or can i store the value of history.go() in some way..

Thanks in advance.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the link to the change profile page is always a POST from a form you can use a hidden variable to let the profile page know how the user got there and thus provide for returning to the right page.
Bill
 
Sarathy Srinivas
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ William.. there are many ways to reach the page. Your method would involve doing this for all the links to that page. this is something that, though possible, im looking to avoid. Is there a way to check the request parameter? If so what method should i use?
[ February 18, 2008: Message edited by: Sarathy Srinivas ]
 
Qussay Najjar
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sarathy Srinivas:
@ William.. there are many ways to reach the page. Your method would involve doing this for all the links to that page. this is something that, though possible, im looking to avoid. Is there a way to check the request parameter? If so what method should i use?

[ February 18, 2008: Message edited by: Sarathy Srinivas ]


here is some code that I've applied in one of my applications,
you'll see the important parts of it:

link in page1.jsp


link in page2.jsp


and so forth..

in page editProfile.jsp


in servlet ProfileEditor inside doPost(request, response)


Honestly speaking, I don't know if it's a professional way to deal
with such trick, but this is only what I did to solve it that time..
hope it helps...
 
Qussay Najjar
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Qussay Najjar:

in page editProfile.jsp



sorry for my mistake, the code in quote should be like this:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic