posted 21 years ago
That sounds an overly-complicated solution to me.
To solve this issue in a simpler way, first you need to decide what constitutes the "I" in "since I last visited the page". Have you already logged on or otherwise authenticated yourself? Is the IP address of your computer enought to identify you?
Once you have something which identifies you to the computer, the simplest way of maintaining "last accessed" information is to place a Map (such as a HashMap) in the "application" context, keyed by your used id, with each entry being a Date object.
For example, in your servlet you might have code like:
This should work for as long as your web application is running, but the data will be lost of the application or the server stops or restarts. For a more permanent solution, you need to persist this information, typically to a file or database.