Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Auge2016-02-16 20:04:15 +0000
committerRaymond Auge2016-02-16 20:04:15 +0000
commitaaa138e4cded371eced945a2a7902f308a80b457 (patch)
tree60ed988ec85ccfa0cb50506ac4ec3a90f39adab0 /bundles/org.eclipse.equinox.http.servlet
parentb8bc4b2dcab828b59ad06f5cae6e81619dbb913e (diff)
downloadrt.equinox.bundles-aaa138e4cded371eced945a2a7902f308a80b457.tar.gz
rt.equinox.bundles-aaa138e4cded371eced945a2a7902f308a80b457.tar.xz
rt.equinox.bundles-aaa138e4cded371eced945a2a7902f308a80b457.zip
Bug 475291 - [equinox jetty] doesn't support the servlet 3.0 multipart API
Change-Id: Ibc4f1c1853da57418b47281a2a1da8bea6b414d4 Signed-off-by: Raymond Auge <raymond.auge@liferay.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.http.servlet')
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF4
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/pom.xml5
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/HttpServiceMultipartServlet.java52
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceRuntimeImpl.java23
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/ContextController.java8
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java4
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/dto/ExtendedServletDTO.java18
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/ServletRegistration.java10
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyMultipartServlet.java52
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyServlet.java43
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/Const.java5
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/DTOUtil.java10
12 files changed, 190 insertions, 44 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF
index 8309753b..ccbab763 100644
--- a/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF
@@ -3,11 +3,11 @@ Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.equinox.http.servlet
-Bundle-Version: 1.2.100.qualifier
+Bundle-Version: 1.3.0.qualifier
Bundle-Activator: org.eclipse.equinox.http.servlet.internal.Activator
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Export-Package: org.eclipse.equinox.http.servlet;version="1.1.0",
+Export-Package: org.eclipse.equinox.http.servlet;version="1.2.0",
org.eclipse.equinox.http.servlet.context; x-internal:=true;version="1.0.0"
Import-Package: javax.servlet;version="[2.3.0,4.0.0)",
javax.servlet.annotation;version="2.6.0";resolution:=optional,
diff --git a/bundles/org.eclipse.equinox.http.servlet/pom.xml b/bundles/org.eclipse.equinox.http.servlet/pom.xml
index 73dfebc6..011f4f9b 100644
--- a/bundles/org.eclipse.equinox.http.servlet/pom.xml
+++ b/bundles/org.eclipse.equinox.http.servlet/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012 Eclipse Foundation.
+ Copyright (c) 2012, 2016 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -8,6 +8,7 @@
Contributors:
Igor Fedorenko - initial implementation
+ Raymond Augé - bug fixes and enhancements
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -19,6 +20,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.http.servlet</artifactId>
- <version>1.2.100-SNAPSHOT</version>
+ <version>1.3.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/HttpServiceMultipartServlet.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/HttpServiceMultipartServlet.java
new file mode 100644
index 00000000..67dbd6c1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/HttpServiceMultipartServlet.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Raymond Augé 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raymond Augé - initial implementation
+ *******************************************************************************/
+package org.eclipse.equinox.http.servlet;
+
+import org.eclipse.equinox.http.servlet.internal.servlet.ProxyMultipartServlet;
+
+/**
+ * The HttpServiceMultipartServlet is the "public" side of a Servlet that when registered (and init() called) in a servlet container
+ * will be used by the OSGi Http Service implementation to handle multipart requests. This servlet must be paired with,
+ * and initialized after an HttpServiceServlet. The HttpServiceServlet must be told the name of the multipart servlet it is paired with
+ * using the init-param "multipart.servlet.name".
+ * <p>
+ * e.g.<br/>
+ * <pre>
+ * &lt;servlet>
+ * &lt;servlet-name>Equinox Http Service Servlet&lt;/servlet-name>
+ * &lt;servlet-class>org.eclipse.equinox.http.servlet.HttpServiceServlet&lt;/servlet-class>
+ * &lt;init-param>
+ * &lt;param-name>multipart.servlet.name&lt;/param-name>
+ * &lt;param-value>Equinox Http Service Multipart Servlet&lt;/param-value>
+ * &lt;/init-param>
+ * &lt;load-on-startup>0&lt;/load-on-startup>
+ * &lt;/servlet>
+ * &lt;servlet>
+ * &lt;servlet-name>Equinox Http Service Multipart Servlet&lt;/servlet-name>
+ * &lt;servlet-class>org.eclipse.equinox.http.servlet.HttpServiceMultipartServlet&lt;/servlet-class>
+ * &lt;load-on-startup>1&lt;/load-on-startup>
+ * &lt;multipart-config>
+ * &lt;location>&lt;/location>
+ * &lt;max-file-size>-1&lt;/max-file-size>
+ * &lt;max-request-size>-1&lt;/max-request-size>
+ * &lt;file-size-threshold>0&lt;/file-size-threshold>
+ * &lt;/multipart-config>
+ * &lt;/servlet>
+ * </pre>
+ * </p>
+ * This class is not meant for extending or even using directly and is purely meant for registering
+ * in a servlet container.
+ * @noextend This class is not intended to be subclassed by clients.
+ * @since 1.3
+ */
+public class HttpServiceMultipartServlet extends ProxyMultipartServlet {
+ private static final long serialVersionUID = 2281118780429323631L;
+}
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 9e28f58f..1bb95fd6 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
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2014, 2015 Raymond Augé and others.
+ * Copyright (c) 2014, 2016 Raymond Augé 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Raymond Augé <raymond.auge@liferay.com> - Bug 436698
+ * Raymond Augé - bug fixes and enhancements
******************************************************************************/
package org.eclipse.equinox.http.servlet.internal;
@@ -19,7 +19,8 @@ import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import javax.servlet.*;
import javax.servlet.Filter;
-import javax.servlet.http.*;
+import javax.servlet.http.HttpSessionAttributeListener;
+import javax.servlet.http.HttpSessionListener;
import org.eclipse.equinox.http.servlet.context.ContextPathCustomizer;
import org.eclipse.equinox.http.servlet.internal.context.*;
import org.eclipse.equinox.http.servlet.internal.error.*;
@@ -359,21 +360,7 @@ public class HttpServiceRuntimeImpl
return legacyIdGenerator.getAndIncrement();
}
- public boolean doDispatch(
- HttpServletRequest request, HttpServletResponse response, String path)
- throws IOException, ServletException {
-
- DispatchTargets dispatchTargets = getDispatchTargets(path, null);
-
- if (dispatchTargets == null) {
- return false;
- }
-
- return dispatchTargets.doDispatch(
- request, response, path, request.getDispatcherType());
- }
-
- private DispatchTargets getDispatchTargets(
+ public DispatchTargets getDispatchTargets(
String requestURI, String extension, String queryString, Match match,
RequestInfoDTO requestInfoDTO) {
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 f07eb69d..85486838 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
@@ -23,6 +23,7 @@ import javax.servlet.Filter;
import javax.servlet.http.*;
import org.eclipse.equinox.http.servlet.internal.HttpServiceRuntimeImpl;
import org.eclipse.equinox.http.servlet.internal.customizer.*;
+import org.eclipse.equinox.http.servlet.internal.dto.ExtendedServletDTO;
import org.eclipse.equinox.http.servlet.internal.error.*;
import org.eclipse.equinox.http.servlet.internal.registration.*;
import org.eclipse.equinox.http.servlet.internal.registration.FilterRegistration;
@@ -480,11 +481,13 @@ public class ContextController {
String servletName = ServiceProperties.parseName(
servletRef.getProperty(
HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME), servletHolder.get());
+ boolean multipartSupported = ServiceProperties.parseBoolean(
+ servletRef, Const.EQUINOX_HTTP_MULTIPARTSUPPORTED);
if (((patterns == null) || (patterns.length == 0)) &&
((errorPages == null) || errorPages.length == 0)) {
throw new IllegalArgumentException(
- "Either patterns or errorPages must contain a value.");
+ "Either patterns or errorPages must contain a value."); //$NON-NLS-1$
}
if (patterns != null) {
@@ -493,10 +496,11 @@ public class ContextController {
}
}
- ServletDTO servletDTO = new ServletDTO();
+ ExtendedServletDTO servletDTO = new ExtendedServletDTO();
servletDTO.asyncSupported = asyncSupported;
servletDTO.initParams = servletInitParams;
+ servletDTO.multipartSupported = multipartSupported;
servletDTO.name = servletName;
servletDTO.patterns = sort(patterns);
servletDTO.serviceId = serviceId;
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java
index a082e27d..7bd78b16 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java
@@ -60,7 +60,7 @@ public class DispatchTargets {
this.string = getClass().getSimpleName() + '[' + contextController.getFullContextPath() + requestURI + ", " + endpointRegistration.toString() + ']'; //$NON-NLS-1$
}
- public boolean doDispatch(
+ public void doDispatch(
HttpServletRequest request, HttpServletResponse response,
String path, DispatcherType dispatcherType)
throws ServletException, IOException {
@@ -85,8 +85,6 @@ public class DispatchTargets {
request, response, this, dispatcherType);
responseStateHandler.processRequest();
-
- return true;
}
finally {
requestWrapper.pop();
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/dto/ExtendedServletDTO.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/dto/ExtendedServletDTO.java
new file mode 100644
index 00000000..88dccf5d
--- /dev/null
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/dto/ExtendedServletDTO.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Raymond Augé.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raymond Augé - Initial implementation
+ ******************************************************************************/
+
+package org.eclipse.equinox.http.servlet.internal.dto;
+
+import org.osgi.service.http.runtime.dto.ServletDTO;
+
+public class ExtendedServletDTO extends ServletDTO {
+ public boolean multipartSupported = false;
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/ServletRegistration.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/ServletRegistration.java
index d22608e7..127330bc 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/ServletRegistration.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/registration/ServletRegistration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2014 Cognos Incorporated, IBM Corporation and others
+ * Copyright (c) 2005, 2016 Cognos Incorporated, IBM Corporation 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
@@ -8,23 +8,23 @@
* Contributors:
* Cognos Incorporated - initial API and implementation
* IBM Corporation - bug fixes and enhancements
- * Raymond Augé <raymond.auge@liferay.com> - Bug 436698
+ * Raymond Augé - bug fixes and enhancements
*******************************************************************************/
package org.eclipse.equinox.http.servlet.internal.registration;
import javax.servlet.Servlet;
import org.eclipse.equinox.http.servlet.internal.context.ContextController;
import org.eclipse.equinox.http.servlet.internal.context.ContextController.ServiceHolder;
+import org.eclipse.equinox.http.servlet.internal.dto.ExtendedServletDTO;
import org.eclipse.equinox.http.servlet.internal.servlet.Match;
import org.osgi.service.http.context.ServletContextHelper;
import org.osgi.service.http.runtime.dto.ErrorPageDTO;
-import org.osgi.service.http.runtime.dto.ServletDTO;
//This class wraps the servlet object registered in the HttpService.registerServlet call, to manage the context classloader when handleRequests are being asked.
-public class ServletRegistration extends EndpointRegistration<ServletDTO> {
+public class ServletRegistration extends EndpointRegistration<ExtendedServletDTO> {
public ServletRegistration(
- ServiceHolder<Servlet> servletHolder, ServletDTO servletDTO, ErrorPageDTO errorPageDTO,
+ ServiceHolder<Servlet> servletHolder, ExtendedServletDTO servletDTO, ErrorPageDTO errorPageDTO,
ServletContextHelper servletContextHelper,
ContextController contextController, ClassLoader legacyTCCL) {
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyMultipartServlet.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyMultipartServlet.java
new file mode 100644
index 00000000..c53baa8c
--- /dev/null
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyMultipartServlet.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Raymond Augé 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Raymond Augé - initial implementation
+ *******************************************************************************/
+package org.eclipse.equinox.http.servlet.internal.servlet;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.*;
+import org.eclipse.equinox.http.servlet.internal.context.DispatchTargets;
+import org.eclipse.equinox.http.servlet.internal.util.Const;
+
+/**
+ * The ProxyMultipartServlet is the private side of a Servlet that when registered (and init() called) in a servlet container
+ * will handle all multipart requests targeted toward it's associated ProxyServlet.
+ * This class is not meant for extending or even using directly and is purely meant for registering
+ * in a servlet container.
+ */
+public class ProxyMultipartServlet extends HttpServlet {
+
+ private static final long serialVersionUID = -9079427283290998897L;
+
+ protected void service(
+ HttpServletRequest request, HttpServletResponse response)
+ throws ServletException, IOException {
+
+ String alias = HttpServletRequestWrapperImpl.getDispatchPathInfo(request);
+
+ if (alias == null) {
+ alias = Const.SLASH;
+ }
+
+ DispatchTargets dispatchTargets = (DispatchTargets)request.getAttribute(DispatchTargets.class.getName());
+
+ if (dispatchTargets != null) {
+ dispatchTargets.doDispatch(
+ request, response, alias, request.getDispatcherType());
+
+ return;
+ }
+
+ response.sendError(
+ HttpServletResponse.SC_NOT_FOUND, "ProxyMultipartServlet: " + alias); //$NON-NLS-1$
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyServlet.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyServlet.java
index 8e88705d..302dec12 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyServlet.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/servlet/ProxyServlet.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2014 Cognos Incorporated, IBM Corporation and others.
+ * Copyright (c) 2005, 2016 Cognos Incorporated, IBM Corporation 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
@@ -8,7 +8,7 @@
* Contributors:
* Cognos Incorporated - initial API and implementation
* IBM Corporation - bug fixes and enhancements
- * Raymond Augé <raymond.auge@liferay.com> - Bug 436698
+ * Raymond Augé - bug fixes and enhancements
*******************************************************************************/
package org.eclipse.equinox.http.servlet.internal.servlet;
@@ -17,6 +17,9 @@ import javax.servlet.*;
import javax.servlet.http.*;
import org.eclipse.equinox.http.servlet.internal.Activator;
import org.eclipse.equinox.http.servlet.internal.HttpServiceRuntimeImpl;
+import org.eclipse.equinox.http.servlet.internal.context.DispatchTargets;
+import org.eclipse.equinox.http.servlet.internal.registration.EndpointRegistration;
+import org.eclipse.equinox.http.servlet.internal.registration.ServletRegistration;
import org.eclipse.equinox.http.servlet.internal.util.Const;
/**
@@ -28,11 +31,15 @@ import org.eclipse.equinox.http.servlet.internal.util.Const;
public class ProxyServlet extends HttpServlet {
private static final long serialVersionUID = 4117456123807468871L;
+ protected static final String MULTIPART_SERVLET_NAME_KEY = "multipart.servlet.name"; //$NON-NLS-1$
private HttpServiceRuntimeImpl httpServiceRuntimeImpl;
+ private String multipartServletName;
public void init(ServletConfig config) throws ServletException {
super.init(config);
+ multipartServletName = getInitParameter(MULTIPART_SERVLET_NAME_KEY);
+
Activator.addProxyServlet(this);
}
@@ -67,19 +74,43 @@ public class ProxyServlet extends HttpServlet {
alias = Const.SLASH;
}
- if (httpServiceRuntimeImpl.doDispatch(request, response, alias)) {
+ DispatchTargets dispatchTargets = httpServiceRuntimeImpl.getDispatchTargets(alias, null);
+
+ if ((dispatchTargets != null) && (multipartServletName != null)) {
+ EndpointRegistration<?> endpointRegistration = dispatchTargets.getServletRegistration();
+
+ if (endpointRegistration instanceof ServletRegistration) {
+ ServletRegistration servletRegistration = (ServletRegistration)endpointRegistration;
+
+ if (servletRegistration.getD().multipartSupported) {
+ RequestDispatcher multipartDispatcher = getServletContext().getNamedDispatcher(multipartServletName);
+
+ if (multipartDispatcher != null) {
+ request.setAttribute(DispatchTargets.class.getName(), dispatchTargets);
+
+ multipartDispatcher.forward(request, response);
+
+ return;
+ }
+ }
+ }
+ }
+
+ if (dispatchTargets != null) {
+ dispatchTargets.doDispatch(
+ request, response, alias, request.getDispatcherType());
+
return;
}
response.sendError(
- HttpServletResponse.SC_NOT_FOUND, "ProxyServlet: " + alias);
+ HttpServletResponse.SC_NOT_FOUND, "ProxyServlet: " + alias); //$NON-NLS-1$
}
private void checkRuntime() {
if (httpServiceRuntimeImpl == null) {
throw new IllegalStateException(
- "Proxy servlet not properly initialized. " +
- "httpServiceRuntimeImpl is null");
+ "Proxy servlet not properly initialized. httpServiceRuntimeImpl is null"); //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/Const.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/Const.java
index 15a31589..651e527e 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/Const.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/Const.java
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2014, 2015 Raymond Augé and others.
+ * Copyright (c) 2014, 2016 Raymond Augé 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Raymond Augé <raymond.auge@liferay.com> - Bug 436698
+ * Raymond Augé - bug fixes and enhancements
******************************************************************************/
package org.eclipse.equinox.http.servlet.internal.util;
@@ -32,6 +32,7 @@ public class Const {
public static final String SLASH_STAR = "/*"; //$NON-NLS-1$
public static final String SLASH_STAR_DOT = "/*."; //$NON-NLS-1$
public static final String STAR_DOT = "*."; //$NON-NLS-1$
+ public static final String EQUINOX_HTTP_MULTIPARTSUPPORTED = "equinox.http.multipartSupported"; //$NON-NLS-1$
public static final String EQUINOX_LEGACY_TCCL_PROP = "equinox.legacy.tccl"; //$NON-NLS-1$
public static final String EQUINOX_LEGACY_CONTEXT_SELECT = "equinox.context.select"; //$NON-NLS-1$
public static final String EQUINOX_LEGACY_CONTEXT_HELPER = "equinox.legacy.context.helper"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/DTOUtil.java b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/DTOUtil.java
index b759fdfd..883d715c 100644
--- a/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/DTOUtil.java
+++ b/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/util/DTOUtil.java
@@ -1,18 +1,19 @@
/*******************************************************************************
- * Copyright (c) Feb 23, 2015 Raymond Augé and others.
+ * Copyright (c) 2015, 2016 Raymond Augé 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Raymond Augé <raymond.auge@liferay.com> - Bug 460639
+ * Raymond Augé - bug fixes and enhancements
******************************************************************************/
package org.eclipse.equinox.http.servlet.internal.util;
import java.lang.reflect.Array;
import java.util.*;
+import org.eclipse.equinox.http.servlet.internal.dto.ExtendedServletDTO;
import org.osgi.dto.DTO;
import org.osgi.service.http.runtime.dto.*;
@@ -146,11 +147,12 @@ public class DTOUtil {
return clone;
}
- public static ServletDTO clone(ServletDTO original) {
- ServletDTO clone = new ServletDTO();
+ public static ExtendedServletDTO clone(ExtendedServletDTO original) {
+ ExtendedServletDTO clone = new ExtendedServletDTO();
clone.asyncSupported = copy(original.asyncSupported);
clone.initParams = copyStringMap(original.initParams);
+ clone.multipartSupported = copy(original.multipartSupported);
clone.name = copy(original.name);
clone.patterns = copy(original.patterns);
clone.serviceId = copy(original.serviceId);

Back to the top