But I think a GetLastAccessedTime
servlet can be created which accesses the session object. Then the applet can be made to access that servelet (by sending an http GET request). Thus it can retrieve the last accessed time.
But why should the applet do this at all? The applet can have a timer
thread running on the client, and so it can keep track of user inactivity, without calling on the server. The applet can have a long timeOut member variable, which can be set in the init() method using getParameter("timeOut"). The timer thread can fire events whenever inactivity nears the timeOut value. The applet gui on getting timer events will flash a warning in the gui.
Of course the last accessed time for the server will be later then the last accessed time on the applet- but that should be no problem- it will give an earlier warning to the user.
Alternatively the applet, whenever it finds that user-inactivity is nearing time out period, instead of warning the user, it can make some request to the server which would reset the last accessed time. Maybe a ResetLastAccessedTimeServlet can be used for this purpose. Maybe there is some method in the api to reset the last accessed time.
Am I thinking right?