I have a requirement like after the session time out how do we get the users previous page like suppose currently i am adding a user i put it my screen like that after certain period of time the session should be time out and the application shows login page. Again the user login to the application i need to show the same page where he was in before session time out.
Once the session is gone, the session is gone--you won't get the same user object instance.
The previous suggestion was to use a session listener (the docs of which are available by clicking on the word HttpSessionListener) to save some state to somewhere (a database, the application context, whatever) and when that user logs in again, use the persisted state to drop them back onto whatever page they were on before their session expired.
This implies you'd need to keep track of what they were doing/where they were throughout their use of the application, of course.