This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JSP and the fly likes automatically redirect to previous page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "automatically redirect to previous page" Watch "automatically redirect to previous page" New topic
Author

automatically redirect to previous page

Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
Can anyone tell me how do i go to previous page on a form submit.(some thing like window.history(1) or history.back(-1) in javascript), here i actually want to go back after a form submit in jsp. but how do i go back to previous page(like embedding this in redirect), i'm doing this as there is some textbox value in the previous page which is disappeared on form submiting but once i hit back button in browser that value is there.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61103
    
  66

That's completely the wrong way to think about it. After the form submission simply forward or redirect back to the same JSP, passing any values you want to restore to form controls as scoped variables. The value attribute of the controls can be used to set initial values.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
thank you Bear.
 
jQuery in Action, 2nd edition
 
subject: automatically redirect to previous page