fix for WW-4610 ServletActionContext.getRequest() doesn't return the
MultiPartRequestWrapper (or StrutsRequestWrapper) when using
StrutsPrepareFilter

Project: http://git-wip-us.apache.org/repos/asf/struts/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/0c92e2a1
Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/0c92e2a1
Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/0c92e2a1

Branch: refs/heads/master
Commit: 0c92e2a1f361b6675ed8ac2c7bc3ffe06603f01a
Parents: f34283b
Author: victorsosa <[email protected]>
Authored: Thu Mar 3 10:06:57 2016 -0400
Committer: victorsosa <[email protected]>
Committed: Thu Mar 3 10:06:57 2016 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/struts2/dispatcher/PrepareOperations.java | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/struts/blob/0c92e2a1/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java 
b/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java
index 547997b..efa4ea7 100644
--- a/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java
+++ b/core/src/main/java/org/apache/struts2/dispatcher/PrepareOperations.java
@@ -26,6 +26,7 @@ import com.opensymphony.xwork2.util.ValueStackFactory;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.struts2.RequestUtils;
+import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.StrutsException;
 import org.apache.struts2.dispatcher.mapper.ActionMapper;
 import org.apache.struts2.dispatcher.mapper.ActionMapping;
@@ -145,6 +146,7 @@ public class PrepareOperations {
             // Wrap request first, just in case it is multipart/form-data
             // parameters might not be accessible through before encoding 
(ww-1278)
             request = dispatcher.wrapRequest(request);
+            ServletActionContext.setRequest(request);
         } catch (IOException e) {
             throw new ServletException("Could not wrap servlet request with 
MultipartRequestWrapper!", e);
         }

Reply via email to