Change-Id: I8d3519bbf0ec47ec66bf08faea15ca00eb45af66tags/7.1.0.beta1
@@ -120,6 +120,11 @@ | |||
url += '&theme=' + encodeURIComponent(theme); | |||
} | |||
var extraParams = getConfig('extraParams') | |||
if (extraParams !== undefined) { | |||
url += extraParams; | |||
} | |||
url += '&' + vaadin.getBrowserDetailsParameters(appId); | |||
// Timestamp to avoid caching |
@@ -54,6 +54,13 @@ import com.vaadin.ui.UI; | |||
@Deprecated | |||
public abstract class BootstrapHandler extends SynchronizedRequestHandler { | |||
/** | |||
* Parameter that is added to the UI init request if the session has already | |||
* been restarted when generating the bootstrap HTML and ?restartApplication | |||
* should thus be ignored when handling the UI init request. | |||
*/ | |||
public static final String IGNORE_RESTART_PARAM = "ignoreRestart"; | |||
protected class BootstrapContext implements Serializable { | |||
private final VaadinResponse response; | |||
@@ -428,6 +435,12 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { | |||
appConfig.put("theme", themeName); | |||
} | |||
// Ignore restartApplication that might be passed to UI init | |||
if (request | |||
.getParameter(VaadinService.URL_PARAMETER_RESTART_APPLICATION) != null) { | |||
appConfig.put("extraParams", "&" + IGNORE_RESTART_PARAM + "=1"); | |||
} | |||
JSONObject versionInfo = new JSONObject(); | |||
versionInfo.put("vaadinVersion", Version.getFullVersion()); | |||
appConfig.put("versionInfo", versionInfo); |
@@ -590,10 +590,12 @@ public abstract class VaadinService implements Serializable, Callback { | |||
* not specifically requested to close or restart it. | |||
*/ | |||
final boolean restartApplication = (request | |||
.getParameter(URL_PARAMETER_RESTART_APPLICATION) != null); | |||
final boolean closeApplication = (request | |||
.getParameter(URL_PARAMETER_CLOSE_APPLICATION) != null); | |||
final boolean restartApplication = hasParameter(request, | |||
URL_PARAMETER_RESTART_APPLICATION) | |||
&& !hasParameter(request, | |||
BootstrapHandler.IGNORE_RESTART_PARAM); | |||
final boolean closeApplication = hasParameter(request, | |||
URL_PARAMETER_CLOSE_APPLICATION); | |||
if (restartApplication) { | |||
closeSession(session, request.getWrappedSession(false)); | |||
@@ -624,6 +626,11 @@ public abstract class VaadinService implements Serializable, Callback { | |||
} | |||
private static boolean hasParameter(VaadinRequest request, | |||
String parameterName) { | |||
return request.getParameter(parameterName) != null; | |||
} | |||
/** | |||
* Creates and registers a new VaadinSession for this service. Assumes | |||
* proper locking has been taken care of by the caller. |