Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/Bug500783_Test.java4
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/context/DispatchTargets.java36
4 files changed, 22 insertions, 22 deletions
diff --git a/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/Bug500783_Test.java b/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/Bug500783_Test.java
index be73438f5..871f1a631 100644
--- a/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/Bug500783_Test.java
+++ b/bundles/org.eclipse.equinox.http.servlet.tests/src/org/eclipse/equinox/http/servlet/tests/Bug500783_Test.java
@@ -52,8 +52,6 @@ public class Bug500783_Test extends BaseTest {
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
int contentLength = req.getContentLength();
- System.out.println(req.getParameterMap().entrySet().toString());
-
InputStream in = req.getInputStream();
// Read the input stream
int bytesRead = 0;
@@ -100,7 +98,7 @@ public class Bug500783_Test extends BaseTest {
map.put("x-www-form-urlencoded", Arrays.<Object>asList("fielda=foo&fieldb=bar"));
Map<String, List<String>> response = requestAdvisor.upload("MyServlet", map);
- assertEquals("21|fieldb=[bar]|fielda=[foo]|0", response.get("responseBody").get(0));
+ assertEquals("21|21", response.get("responseBody").get(0));
assertEquals(HttpServletResponse.SC_OK + "", response.get("responseCode").get(0));
}
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 3f1e1e616..cd1129c4c 100644
--- a/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.equinox.http.servlet
-Bundle-Version: 1.6.200.qualifier
+Bundle-Version: 1.6.300.qualifier
Bundle-Activator: org.eclipse.equinox.http.servlet.internal.Activator
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
diff --git a/bundles/org.eclipse.equinox.http.servlet/pom.xml b/bundles/org.eclipse.equinox.http.servlet/pom.xml
index 7a4021d3a..5c6b2f307 100644
--- a/bundles/org.eclipse.equinox.http.servlet/pom.xml
+++ b/bundles/org.eclipse.equinox.http.servlet/pom.xml
@@ -20,6 +20,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.http.servlet</artifactId>
- <version>1.6.200-SNAPSHOT</version>
+ <version>1.6.300-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
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 d0dace994..14a1beb53 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,22 +60,7 @@ public class DispatchTargets {
}
public void addRequestParameters(HttpServletRequest request) {
- if (queryString == null) {
- parameterMap = request.getParameterMap();
- queryString = request.getQueryString();
-
- return;
- }
-
- Map<String, String[]> parameterMapCopy = queryStringToParameterMap(queryString);
-
- for (Map.Entry<String, String[]> entry : request.getParameterMap().entrySet()) {
- String[] values = parameterMapCopy.get(entry.getKey());
- values = Params.append(values, entry.getValue());
- parameterMapCopy.put(entry.getKey(), values);
- }
-
- parameterMap = Collections.unmodifiableMap(parameterMapCopy);
+ currentRequest = request;
}
public void doDispatch(
@@ -154,6 +139,19 @@ public class DispatchTargets {
}
public Map<String, String[]> getParameterMap() {
+ if ((parameterMap == null) && (currentRequest != null)) {
+ Map<String, String[]> parameterMapCopy = queryStringToParameterMap(queryString);
+
+ for (Map.Entry<String, String[]> entry : currentRequest.getParameterMap().entrySet()) {
+ String[] values = parameterMapCopy.get(entry.getKey());
+ if (!Arrays.equals(values, entry.getValue())) {
+ values = Params.append(values, entry.getValue());
+ parameterMapCopy.put(entry.getKey(), values);
+ }
+ }
+
+ parameterMap = Collections.unmodifiableMap(parameterMapCopy);
+ }
return parameterMap;
}
@@ -162,6 +160,9 @@ public class DispatchTargets {
}
public String getQueryString() {
+ if ((queryString == null) && (currentRequest != null)) {
+ queryString = currentRequest.getQueryString();
+ }
return queryString;
}
@@ -207,7 +208,7 @@ public class DispatchTargets {
private static Map<String, String[]> queryStringToParameterMap(String queryString) {
if ((queryString == null) || (queryString.length() == 0)) {
- return new HashMap<String, String[]>();
+ return new LinkedHashMap<String, String[]>();
}
try {
@@ -264,6 +265,7 @@ public class DispatchTargets {
private final ContextController contextController;
private DispatcherType dispatcherType;
private final EndpointRegistration<?> endpointRegistration;
+ private volatile HttpServletRequest currentRequest;
private final List<FilterRegistration> matchingFilterRegistrations;
private final String pathInfo;
private Map<String, String[]> parameterMap;

Back to the top