Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnjum Fatima2019-05-14 16:57:43 -0400
committerAnjum Fatima2019-05-15 17:23:34 -0400
commitb8aa72dc4730e6c678972b0bd3a70f7345ed78bf (patch)
tree0f78c12f99bca7b9813dae767ead194ad793a82f
parenta81dff381261aa69c327637026d701f6f48d29ec (diff)
downloadrt.equinox.bundles-b8aa72dc4730e6c678972b0bd3a70f7345ed78bf.tar.gz
rt.equinox.bundles-b8aa72dc4730e6c678972b0bd3a70f7345ed78bf.tar.xz
rt.equinox.bundles-b8aa72dc4730e6c678972b0bd3a70f7345ed78bf.zip
Bug 547274 - [http whiteboard] Tolerate Servlet 3.0 in
HttpServiceRuntimeImpl Change-Id: I6e57158227b55ffdb009897dcb23c2230122574f Signed-off-by: Anjum Fatima <anjum.eclipse@gmail.com>
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java
index c0e9df3b..8d07030b 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java
@@ -68,7 +68,7 @@ public class HttpServiceRuntimeImpl
this.servletServiceFilter = createServletFilter(consumingContext);
this.resourceServiceFilter = createResourceFilter(consumingContext);
this.filterServiceFilter = createFilterFilter(consumingContext);
- this.listenerServiceFilter = createListenerFilter(consumingContext);
+ this.listenerServiceFilter = createListenerFilter(consumingContext, parentServletContext);
this.parentServletContext = parentServletContext;
this.attributes = new UMDictionaryMap<String, Object>(attributes);
@@ -1079,7 +1079,7 @@ public class HttpServiceRuntimeImpl
}
}
- private static org.osgi.framework.Filter createListenerFilter(BundleContext context) {
+ private static org.osgi.framework.Filter createListenerFilter(BundleContext context, ServletContext servletContext) {
StringBuilder sb = new StringBuilder();
sb.append("(&"); //$NON-NLS-1$
@@ -1091,7 +1091,9 @@ public class HttpServiceRuntimeImpl
sb.append("(objectClass=").append(ServletRequestAttributeListener.class.getName()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
sb.append("(objectClass=").append(HttpSessionListener.class.getName()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
sb.append("(objectClass=").append(HttpSessionAttributeListener.class.getName()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
- sb.append("(objectClass=").append(HttpSessionIdListener.class.getName()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
+ if ((servletContext.getMajorVersion() >= 3) && (servletContext.getMinorVersion() > 0)) {
+ sb.append("(objectClass=").append(HttpSessionIdListener.class.getName()).append(")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
sb.append(")"); //$NON-NLS-1$
sb.append(")"); //$NON-NLS-1$

Back to the top