Detecting page reload of the browser [message #502944] |
Thu, 10 December 2009 11:59 |
Sascha Becher Messages: 17 Registered: December 2009 |
Junior Member |
|
|
I have implemented a login dialog that opens prior to the perspective in openWindows():
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
@Override
public boolean openWindows() {
LoginDialog loginDialog = new LoginDialog();
loginDialog.open();
}
}
// login is done via JAAS and JBoss org.jboss.security.client.SecurityClient
SecurityClient securityClient = SecurityClientFactory.getSecurityClient();
securityClient.setSimple(userName, password);
securityClient.login();
This works fine. When the user hits F5 in his browser, the Perspective is being rebuild. So the WorkbenchAdvisor calls again openWindows(), and the LoginDialog re-appears. I have no session information at this moment, so I can't decide, to skip the login dialog.
How can I detect a browser reload?
Edit:
Does a web page reload on a RAP application always destroys the session as outlined here? http://www.eclipse.org/forums/index.php?t=tree&th=42428
The RAP online demos treat F5 as a simple GUI redraw, which is a fine feature as long as there is no session information incorporated.
Edit:
I added a SessionStoreListener. The beforeDestroy() is being called just after the page reload. Curiously the session id stays the same with several page reloads. Can I re-register the HttpSession object somehow?
RWT.getSessionStore().addSessionStoreListener(new SessionStoreListener() {
@Override
public void beforeDestroy(SessionStoreEvent event) {
HttpSession session = event.getSessionStore().getHttpSession();
System.out.println("SESSION destroyed, session id = " + session.getId()); //$NON-NLS-1$
}
});
[Updated on: Thu, 10 December 2009 13:03] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03146 seconds