aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2012-05-04 14:19:12 +0300
committerArtur Signell <artur@vaadin.com>2012-05-11 22:18:33 +0300
commit9fd13d260c3b0510272abed2170decf709f1062d (patch)
treeafd526a265bcd56886f6f3b2abb1c2b21727c73f /src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
parentd5ea720082ecbfea98310ea9c860d7ce0ce9757e (diff)
downloadvaadin-framework-9fd13d260c3b0510272abed2170decf709f1062d.tar.gz
vaadin-framework-9fd13d260c3b0510272abed2170decf709f1062d.zip
Send widgetset version with the first UIDL request
This enables the server to verify that the widgetset version match the servlet version
Diffstat (limited to 'src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java')
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index 97cb3114b9..8f942d9aee 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -45,6 +45,7 @@ import java.util.logging.Logger;
import com.vaadin.Application;
import com.vaadin.Application.SystemMessages;
import com.vaadin.RootRequiresMoreInformationException;
+import com.vaadin.Version;
import com.vaadin.external.json.JSONArray;
import com.vaadin.external.json.JSONException;
import com.vaadin.external.json.JSONObject;
@@ -499,6 +500,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
WrappedResponse response, Callback callback, Root root)
throws IOException, InvalidUIDLSecurityKeyException {
+ checkWidgetsetVersion(request);
requestThemeName = request.getParameter("theme");
maxInactiveInterval = request.getSessionMaxInactiveInterval();
// repaint requested or session has timed out and new one is created
@@ -586,6 +588,27 @@ public abstract class AbstractCommunicationManager implements Serializable {
}
/**
+ * Checks that the version reported by the client (widgetset) matches that
+ * of the server.
+ *
+ * @param request
+ */
+ private void checkWidgetsetVersion(WrappedRequest request) {
+ String widgetsetVersion = request.getParameter("wsver");
+ if (widgetsetVersion == null) {
+ // Only check when the widgetset version is reported. It is reported
+ // in the first UIDL request (not the initial request as it is a
+ // plain GET /)
+ return;
+ }
+
+ if (!Version.getFullVersion().equals(widgetsetVersion)) {
+ logger.warning(String.format(Constants.WIDGETSET_MISMATCH_INFO,
+ Version.getFullVersion(), widgetsetVersion));
+ }
+ }
+
+ /**
* Method called after the paint phase while still being synchronized on the
* application
*