Hi,
I am not sure how to go about with JSF, but I had been working on Spring MVC.
Let me explain in generic.
Following will be needed:
1. 2 tokens to identify the current page and the next page in the current JSP.
2. method abc () to be called in all the requests.
Tokens:
------
There will be two hidden variables, currentPage and nextPage in the page.
The currentPage will have a hardcoded value for each page.
The nextPage will take the name of the next page when the event handler is called in javascript.
Session update:
--------------
When the request successfully moves from one page to another, a variable currentPage will be stored in the session with the destination page (nextPage).
This happens before the forward is returned by an action method.
Action Class Update:
-------------------
All the methods of the action class will have to call the super class method abc() which will perform the following:
This will read the currentPage attribute from the request parameter and compare the same with the session variable.
In case, the variables are the same, proceed to perform the action, else redirect to the session invalid page.
Hope this will suffice your requirement.
Rajiv