Source:
<code>public void renderHead(Component component, IHeaderResponse response) { super.renderHead(component, response); response.render(JavaScriptHeaderItem.forReference(WicketWebSocketJQueryResourceReference.get())); PackageTextTemplate webSocketSetupTemplate = new PackageTextTemplate(WicketWebSocketJQueryResourceReference.class, "res/js/wicket-websocket-setup.js.tmpl"); Map<String, Object> variables = Generics.newHashMap(); if (Strings.isEmpty(resourceName)) { int pageId = component.getPage().getPageId(); variables.put("pageId", pageId); variables.put("resourceName", ""); <START> variables.put("resourceToken", ""); <END> } else { variables.put("resourceName", resourceName); variables.put("resourceToken", resourceToken); variables.put("pageId", false); } WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(component.getApplication()); CharSequence baseUrl = getBaseUrl(webSocketSettings); Args.notNull(baseUrl, "baseUrl"); variables.put("baseUrl", baseUrl); Integer port = getPort(webSocketSettings); variables.put("port", port); Integer securePort = getSecurePort(webSocketSettings); variables.put("securePort", securePort); CharSequence contextPath = getContextPath(webSocketSettings); Args.notNull(contextPath, "contextPath"); variables.put("contextPath", contextPath); variables.put("applicationName", component.getApplication().getName()); CharSequence filterPrefix = getFilterPrefix(webSocketSettings); Args.notNull(filterPrefix, "filterPrefix"); variables.put("filterPrefix", filterPrefix); final CharSequence sessionId = getSessionId(component); variables.put("sessionId", sessionId); String webSocketSetupScript = webSocketSetupTemplate.asString(variables); response.render(OnDomReadyHeaderItem.forScript(webSocketSetupScript)); }</code><technical_language>token is supported for Resource for Page ? In case of a Page locking page instance work sequential work, I think</technical_language>

Target:
public void renderHead(Component component, IHeaderResponse response) { super.renderHead(component, response); response.render(JavaScriptHeaderItem.forReference(WicketWebSocketJQueryResourceReference.get())); PackageTextTemplate webSocketSetupTemplate = new PackageTextTemplate(WicketWebSocketJQueryResourceReference.class, "res/js/wicket-websocket-setup.js.tmpl"); Map<String, Object> variables = Generics.newHashMap(); if (Strings.isEmpty(resourceName)) { int pageId = component.getPage().getPageId(); variables.put("pageId", pageId); variables.put("resourceName", ""); variables.put("connectionToken", ""); } else { variables.put("resourceName", resourceName); variables.put("connectionToken", connectionToken); variables.put("pageId", false); } WebSocketSettings webSocketSettings = WebSocketSettings.Holder.get(component.getApplication()); CharSequence baseUrl = getBaseUrl(webSocketSettings); Args.notNull(baseUrl, "baseUrl"); variables.put("baseUrl", baseUrl); Integer port = getPort(webSocketSettings); variables.put("port", port); Integer securePort = getSecurePort(webSocketSettings); variables.put("securePort", securePort); CharSequence contextPath = getContextPath(webSocketSettings); Args.notNull(contextPath, "contextPath"); variables.put("contextPath", contextPath); variables.put("applicationName", component.getApplication().getName()); CharSequence filterPrefix = getFilterPrefix(webSocketSettings); Args.notNull(filterPrefix, "filterPrefix"); variables.put("filterPrefix", filterPrefix); final CharSequence sessionId = getSessionId(component); variables.put("sessionId", sessionId); String webSocketSetupScript = webSocketSetupTemplate.asString(variables); response.render(OnDomReadyHeaderItem.forScript(webSocketSetupScript)); }