Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2016-05-03 06:28:43 -0400
committerIvan Furnadjiev2016-05-03 08:02:54 -0400
commit512c7f63cf75631f9b9a7876bfdb854ea592fb2f (patch)
tree998d25ec9d25956301333288e507525d8ffe7f3f /bundles
parent9bdd416e3021c3b202bf968309de7b088febe1fc (diff)
downloadorg.eclipse.rap-512c7f63cf75631f9b9a7876bfdb854ea592fb2f.tar.gz
org.eclipse.rap-512c7f63cf75631f9b9a7876bfdb854ea592fb2f.tar.xz
org.eclipse.rap-512c7f63cf75631f9b9a7876bfdb854ea592fb2f.zip
Support base URL in ServiceManagerImpl
ServiceManager#getServiceHandlerUrl(String) returns absolute URL (see bug 437211). If the application is deployed behind url rewriting proxy, the URL segment added by the proxy is missing from service handler URL. Respect "org.eclipse.rap.rwt.serviceHandlerBaseURL" system property in ServiceManagerImpl. 492175: FileDialog doesn't work behind proxy https://bugs.eclipse.org/bugs/show_bug.cgi?id=492175 Change-Id: I10a5410f198441b53d71b85d8062b9992c59b8ce
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/RWTProperties.java7
-rw-r--r--bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/service/ServiceManagerImpl.java10
2 files changed, 14 insertions, 3 deletions
diff --git a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/RWTProperties.java b/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/RWTProperties.java
index 11b7119a56..dd3f423da9 100644
--- a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/RWTProperties.java
+++ b/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/RWTProperties.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2015 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2002, 2016 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@ package org.eclipse.rap.rwt.internal;
public final class RWTProperties {
+ public static final String SERVICE_HANDLER_BASE_URL = "org.eclipse.rap.rwt.serviceHandlerBaseURL";
public static final String DEVELOPMEMT_MODE = "org.eclipse.rap.rwt.developmentMode";
/*
@@ -26,6 +27,10 @@ public final class RWTProperties {
// prevent instantiation
}
+ public static String getServiceHandlerBaseUrl() {
+ return System.getProperty( SERVICE_HANDLER_BASE_URL );
+ }
+
public static boolean isDevelopmentMode() {
return getBooleanProperty( DEVELOPMEMT_MODE, false );
}
diff --git a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/service/ServiceManagerImpl.java b/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/service/ServiceManagerImpl.java
index 228f2c9dc3..c86b610787 100644
--- a/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/service/ServiceManagerImpl.java
+++ b/bundles/org.eclipse.rap.rwt/src/org/eclipse/rap/rwt/internal/service/ServiceManagerImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2002, 2015 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2002, 2016 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@ import java.net.URLEncoder;
import javax.servlet.http.HttpServletRequest;
+import org.eclipse.rap.rwt.internal.RWTProperties;
import org.eclipse.rap.rwt.internal.util.ParamCheck;
import org.eclipse.rap.rwt.service.ServiceHandler;
import org.eclipse.rap.rwt.service.ServiceManager;
@@ -61,7 +62,12 @@ public class ServiceManagerImpl implements ServiceManager {
public String getServiceHandlerUrl( String id ) {
ParamCheck.notNull( id, "id" );
HttpServletRequest request = ContextProvider.getRequest();
- StringBuilder url = new StringBuilder( request.getRequestURI() )
+ StringBuilder url = new StringBuilder();
+ String baseUrl = RWTProperties.getServiceHandlerBaseUrl();
+ if( baseUrl != null ) {
+ url.append( baseUrl );
+ }
+ url.append( request.getRequestURI() )
.append( '?' )
.append( REQUEST_PARAM )
.append( '=' )

Back to the top