* Entry point classes (widgetsets) define <code>onModuleLoad()</code>.
*/
public class ApplicationConnection {
+ public static final String APP_REQUEST_PATH = "APP/";
+
+ public static final String UIDL_REQUEST_PATH = "UIDL/";
+
+ public static final String APP_PROTOCOL_PREFIX = "app://";
+
public static final String V_RESOURCE_PATH = "v-resourcePath";
- private static final String CONNECTOR_PROTOCOL_PREFIX = "connector://";
+ public static final String CONNECTOR_PROTOCOL_PREFIX = "connector://";
- public static final String CONNECTOR_RESOURCE_PREFIX = "APP/CONNECTOR";
+ public static final String CONNECTOR_RESOURCE_PREFIX = APP_REQUEST_PATH
+ + "CONNECTOR";
// This indicates the whole page is generated by us (not embedded)
public static final String GENERATED_BODY_CLASSNAME = "v-generated-body";
final String payload = uidlSecurityKey + VAR_BURST_SEPARATOR
+ requestData;
VConsole.log("Making UIDL Request with params: " + payload);
- String uri = translateVaadinUri("app://UIDL");
+ String uri = translateVaadinUri(APP_PROTOCOL_PREFIX + UIDL_REQUEST_PATH);
if (extraParams != null && extraParams.length() > 0) {
uri = addGetParameters(uri, extraParams);
// getAppUri *should* always end with /
// substring *should* always start with / (connector:///foo.bar
// without connector://)
- uidlUri = "app://" + CONNECTOR_RESOURCE_PREFIX
+ uidlUri = APP_PROTOCOL_PREFIX + CONNECTOR_RESOURCE_PREFIX
+ uidlUri.substring(CONNECTOR_PROTOCOL_PREFIX.length());
// Let translation of app:// urls take care of the rest
}
- if (uidlUri.startsWith("app://")) {
- String relativeUrl = uidlUri.substring(6);
+ if (uidlUri.startsWith(APP_PROTOCOL_PREFIX)) {
+ String relativeUrl = uidlUri
+ .substring(APP_PROTOCOL_PREFIX.length());
if (getConfiguration().usePortletURLs()) {
// Should put path in v-resourcePath parameter and append query
// params to base portlet url
String path = parts[0];
String url = getConfiguration().getPortletResourceUrl();
+
+ // If there's a "?" followed by something, append it as a query
+ // string to the base URL
if (parts.length > 1) {
String appUrlParams = parts[1];
url = addGetParameters(url, appUrlParams);
import com.vaadin.Application;
import com.vaadin.service.ApplicationContext;
import com.vaadin.terminal.ApplicationResource;
+import com.vaadin.terminal.gwt.client.ApplicationConnection;
/**
* Base class for web application contexts (including portlet contexts) that
final String filename = resource.getFilename();
if (filename == null) {
- return "app://APP/" + mapKey + "/";
+ return ApplicationConnection.APP_PROTOCOL_PREFIX
+ + ApplicationConnection.APP_REQUEST_PATH + mapKey + "/";
} else {
// #7738 At least Tomcat and JBoss refuses requests containing
// encoded slashes or backslashes in URLs. Application resource URLs
// in the future.
String encodedFileName = urlEncode(filename).replace("%2F", "/")
.replace("%5C", "\\");
- return "app://APP/" + mapKey + "/" + encodedFileName;
+ return ApplicationConnection.APP_PROTOCOL_PREFIX
+ + ApplicationConnection.APP_REQUEST_PATH + mapKey + "/"
+ + encodedFileName;
}
}