• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

going back

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
reply
    Bookmark Topic Watch Topic
  • New Topic