Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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