int screenHeight = BrowserInfo.get().getScreenHeight();
int tzOffset = BrowserInfo.get().getTimezoneOffset();
int rtzOffset = BrowserInfo.get().getRawTimezoneOffset();
+ String widgetsetVersion = ApplicationConfiguration.VERSION;
String token = History.getToken();
String parameters = "repaintAll=1&" + "sh=" + screenHeight + "&sw="
+ screenWidth + "&cw=" + clientWidth + "&ch=" + clientHeight
+ "&vw=" + offsetWidth + "&vh=" + offsetHeight + "&fr=" + token
- + "&tzo=" + tzOffset + "&rtzo=" + rtzOffset;
+ + "&tzo=" + tzOffset + "&rtzo=" + rtzOffset + "&wsver="
+ + widgetsetVersion;
return parameters;
}
}
}
+ /**
+ * Checks that the version reported by the client (widgetset) matches that
+ * of the server.
+ *
+ * @param request
+ */
+ private void checkWidgetsetVersion(PortletRequest request) {
+ if (!AbstractApplicationServlet.VERSION.equals(getHTTPRequestParameter(
+ request, "wsver"))) {
+ logger.warning(String.format(WIDGETSET_MISMATCH_INFO,
+ AbstractApplicationServlet.VERSION,
+ getHTTPRequestParameter(request, "wsver")));
+ }
+ }
+
private void checkProductionMode() {
// Check if the application is in production mode.
// We are in production mode if Debug=false or productionMode=true
return;
} else if (requestType == RequestType.UIDL) {
// Handles AJAX UIDL requests
+ if (isRepaintAll(request)) {
+ // warn if versions do not match
+ checkWidgetsetVersion(request);
+ }
applicationManager.handleUidlRequest(
(ResourceRequest) request,
(ResourceResponse) response, this, window);
}
}
+ /**
+ * Checks that the version reported by the client (widgetset) matches that
+ * of the server.
+ *
+ * @param request
+ */
+ private void checkWidgetsetVersion(HttpServletRequest request) {
+ if (!VERSION.equals(request.getParameter("wsver"))) {
+ logger.warning(String.format(WIDGETSET_MISMATCH_INFO, VERSION,
+ request.getParameter("wsver")));
+ }
+ }
+
private void checkProductionMode() {
// Check if the application is in production mode.
// We are in production mode if Debug=false or productionMode=true
return;
}
+ if (isRepaintAll(request)) {
+ // warn if versions do not match
+ checkWidgetsetVersion(request);
+ }
+
Application application = null;
boolean transactionStarted = false;
boolean requestStarted = false;
+ "in web.xml. The default of 1h will be used.\n"
+ "===========================================================";
+ static final String WIDGETSET_MISMATCH_INFO = "\n"
+ + "=================================================================\n"
+ + "The widgetset in use does not seem to be built for the Vaadin\n"
+ + "version in use. This might cause strange problems - a\n"
+ + "recompile/deploy is strongly recommended.\n"
+ + " Vaadin version: %s\n"
+ + " Widgetset version: %s\n"
+ + "=================================================================";
+
static final String URL_PARAMETER_RESTART_APPLICATION = "restartApplication";
static final String URL_PARAMETER_CLOSE_APPLICATION = "closeApplication";
static final String URL_PARAMETER_REPAINT_ALL = "repaintAll";