Bug 474714 - [http whiteboard] regression in accessing parent
ServletContext init params
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/ContextController.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/ContextController.java
index 569b78d..874203e 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/ContextController.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/ContextController.java
@@ -136,7 +136,7 @@
 		this.contextServiceId = serviceId;
 
 		this.initParams = ServiceProperties.parseInitParams(
-			servletContextHelperRef, HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_INIT_PARAM_PREFIX);
+			servletContextHelperRef, HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_INIT_PARAM_PREFIX, proxyContext.getServletContext());
 
 		this.trackingContext = trackingContextParam;
 		this.consumingContext = consumingContext;
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/ServiceProperties.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/ServiceProperties.java
index 9260a78..7b24f94 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/ServiceProperties.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/ServiceProperties.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) Dec 2, 2014 Liferay, Inc.
+ * Copyright (c) 2014, 2015 Liferay, Inc.
  * 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
@@ -13,6 +13,7 @@
 package org.eclipse.equinox.http.servlet.internal.util;
 
 import java.util.*;
+import javax.servlet.ServletContext;
 import org.osgi.framework.ServiceReference;
 
 public class ServiceProperties {
@@ -32,10 +33,18 @@
 	}
 
 	static public Map<String, String> parseInitParams(
-		ServiceReference<?> serviceReference, String prefix) {
+		ServiceReference<?> serviceReference, String prefix, ServletContext parentContext) {
 
 		Map<String, String> initParams = new HashMap<String, String>();
 
+		if (parentContext != null) {
+			// use the parent context init params;
+			// but allow them to be overriden below by service properties
+			for (Enumeration<String> initParamNames = parentContext.getInitParameterNames(); initParamNames.hasMoreElements();) {
+				String key = initParamNames.nextElement();
+				initParams.put(key, parentContext.getInitParameter(key));
+			}
+		}
 		for (String key : serviceReference.getPropertyKeys()) {
 			if (key.startsWith(prefix)) {
 				initParams.put(
@@ -47,6 +56,11 @@
 		return Collections.unmodifiableMap(initParams);
 	}
 
+	static public Map<String, String> parseInitParams(
+		ServiceReference<?> serviceReference, String prefix) {
+		return parseInitParams(serviceReference, prefix, null);
+	}
+
 	static public String parseName(Object property, Object object) {
 		if (property == null) {
 			return object.getClass().getName();