Hi martin and samuli ,
I found a solution for the above problem .
Assume the traverse should happen from
P1 -----R1------>P2-----R2----->P3-----R3----->P4-----R4----->P5 .
where Pn is page and Rn is the Server Reponse as told earlier here when we navigate from P1 to P2 , the server response is R1 now if we replace that with R4 it is getting navigated to P5.
now every page as got its own name,
so when you navigate from P1 to P2 , use session to store a value i.e session.setattribute("", ""); , of type string , which is comibnation of pagename to which navigation should happen and session id, so here it is P2_sessionID,
In all the pages write code that when page is getting loaded that it should read value from the session,
now when P2 is getting loaded write a code to fetch the value from the session, so it should P2_sessionID, in case R1 is being replaced by server response R4 then you will navigate to P5 , now in P5 when loading , read value from session we get P2_session id , here P2 is the page that should have been loaded but P5 is getting loaded , so in P5 write a code to invalidate the session and logoff the user .
if any better standard approach exits please suggest , so that i could follow that.
Regards
Govardan