diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-06-11 15:34:11 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2012-06-11 15:34:11 +0300 |
commit | 560696300cf957d5c340ad7668c1a123916d7855 (patch) | |
tree | f4da05b1892fe86b188f89aa462143254fa0b979 | |
parent | 3b5b81a8ce6fa0e3cd7b90739649264eb6eb5580 (diff) | |
parent | 35b979139f4fbb6e6bbc19728951277adce394b7 (diff) | |
download | vaadin-framework-560696300cf957d5c340ad7668c1a123916d7855.tar.gz vaadin-framework-560696300cf957d5c340ad7668c1a123916d7855.zip |
Merge commit '35b979'
-rw-r--r-- | src/com/vaadin/terminal/gwt/client/ApplicationConnection.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 0a954f530b..e8013ccc72 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -369,6 +369,25 @@ public class ApplicationConnection { }-*/; /** + * If on Liferay and logged in, ask the client side session management + * JavaScript to extend the session duration. + * + * Otherwise, Liferay client side JavaScript will explicitly expire the + * session even though the server side considers the session to be active. + * See ticket #8305 for more information. + */ + protected native void extendLiferaySession() + /*-{ + if ($wnd.Liferay && $wnd.Liferay.Session) { + $wnd.Liferay.Session.extend(); + // if the extend banner is visible, hide it + if ($wnd.Liferay.Session.banner) { + $wnd.Liferay.Session.banner.remove(); + } + } + }-*/; + + /** * Get the active Console for writing debug messages. May return an actual * logging console, or the NullConsole if debugging is not turned on. * @@ -850,6 +869,14 @@ public class ApplicationConnection { public void execute() { if (!hasActiveRequest()) { hideLoadingIndicator(); + + // If on Liferay and session expiration management is in + // use, extend session duration on each request. + // Doing it here rather than before the request to improve + // responsiveness. + // Postponed until the end of the next request if other + // requests still pending. + extendLiferaySession(); } } }); |