From 63fa04e8146ec02fc256fa35a93454482254dcef Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Tue, 16 Sep 2014 08:51:16 +0200 Subject: [PATCH] WW-4345 Reverts the commit 8aa4fe860693d29e5ef94026bf2a7532ed74b9ea --- .../apache/struts2/dispatcher/Dispatcher.java | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java b/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java index 436490ea3..c18d055e6 100644 --- a/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java +++ b/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java @@ -79,8 +79,6 @@ public class Dispatcher { */ private static final Logger LOG = LoggerFactory.getLogger(Dispatcher.class); - public static final String MULTIPART_FORM_DATA = "multipart/form-data"; - /** * Provide a thread local instance. */ @@ -630,7 +628,7 @@ public class Dispatcher { Map requestMap = new RequestMap(request); // parameters map wrapping the http parameters. ActionMapping parameters are now handled and applied separately - Map params = prepareParametersMap(request); + Map params = new HashMap(request.getParameterMap()); // session map wrapping the http session Map session = new SessionMap(request); @@ -646,21 +644,6 @@ public class Dispatcher { return extraContext; } - /** - * Copies or creates new map to hold request parameters, - * there is a special treatment when uploading a file see WW-4345 - */ - protected Map prepareParametersMap(HttpServletRequest request) { - Map params; - String contentType = request.getContentType(); - if (contentType != null && contentType.contains(MULTIPART_FORM_DATA)) { - params = new HashMap(); - } else { - params = new HashMap(request.getParameterMap()); - } - return params; - } - /** * @deprecated use version without ServletContext param */ @@ -849,7 +832,7 @@ public class Dispatcher { } String content_type = request.getContentType(); - if (content_type != null && content_type.contains(MULTIPART_FORM_DATA)) { + if (content_type != null && content_type.contains("multipart/form-data")) { MultiPartRequest mpr = getMultiPartRequest(); LocaleProvider provider = getContainer().getInstance(LocaleProvider.class); request = new MultiPartRequestWrapper(mpr, request, getSaveDir(), provider);