wood burning stoves 2.0*
The moose likes Servlets and the fly likes using history.go(-1) on servlet 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 » Servlets
Reply locked New topic
Author

using history.go(-1) on servlet page

Abhishekshri Shrivastava
Ranch Hand

Joined: Jan 13, 2011
Posts: 31
hi,

please tell me how can i use "history.go(-1)" on servlet..

or
how can i come back to the same jsp from which request was sent to the servlet. i do also want to retain the all html element control value as it was.
i have to use history.go() only.
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3060
    
  38

Is this the same question as this one ?

There are two ways to get that done: One is using JavaScript functions as you proposed. The other way is dispatching the request to the initiating jsp, and filling 'value' attributes. The instructions for that is mentioned in the above mentioned topic.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Abhishekshri Shrivastava
Ranch Hand

Joined: Jan 13, 2011
Posts: 31
yes the ultimate aim of both the questions is same to the retain all old value on jsp.
now i am bit able to do the thing in following way:
as i am not permitted to add anything on old jsp. so i am using an intermidiate jsp. i will forward request to intermediate jsp and will have a page onload event (java script function) to do
window.history.go(-1);
it's working fine.
only hting i need to check wheather can i show any new message using a session variable on old jsp.
i am going through it.
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3060
    
  38

Abhishekshri Shrivastava wrote:yes the ultimate aim of both the questions is same....

I'm locking this one - let's continue the discussion in your other topic. If you find any issue with your JavaScript approach, please start a specific topic on Html/JavaScripts forum.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: using history.go(-1) on servlet page