You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by tm...@apache.org on 2006/04/27 17:43:33 UTC

svn commit: r397572 - /incubator/webwork2/action/src/main/java/org/apache/struts/action2/dispatcher/FilterDispatcher.java

Author: tmjee
Date: Thu Apr 27 08:43:30 2006
New Revision: 397572

URL: http://svn.apache.org/viewcvs?rev=397572&view=rev
Log:
WW-1278


Modified:
    incubator/webwork2/action/src/main/java/org/apache/struts/action2/dispatcher/FilterDispatcher.java

Modified: incubator/webwork2/action/src/main/java/org/apache/struts/action2/dispatcher/FilterDispatcher.java
URL: http://svn.apache.org/viewcvs/incubator/webwork2/action/src/main/java/org/apache/struts/action2/dispatcher/FilterDispatcher.java?rev=397572&r1=397571&r2=397572&view=diff
==============================================================================
--- incubator/webwork2/action/src/main/java/org/apache/struts/action2/dispatcher/FilterDispatcher.java (original)
+++ incubator/webwork2/action/src/main/java/org/apache/struts/action2/dispatcher/FilterDispatcher.java Thu Apr 27 08:43:30 2006
@@ -163,10 +163,20 @@
     public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
         HttpServletRequest request = (HttpServletRequest) req;
         HttpServletResponse response = (HttpServletResponse) res;
+        ServletContext servletContext = filterConfig.getServletContext();
 
         // prepare the request no matter what - this ensures that the proper character encoding
         // is used before invoking the mapper (see WW-9127)
         DispatcherUtils du = DispatcherUtils.getInstance();
+        try {
+        	// Wrap request first, just in case it is multipart/form-data 
+        	// parameters might not be accessible through before encoding (ww-1278)
+            request = du.wrapRequest(request, servletContext);
+        } catch (IOException e) {
+            String message = "Could not wrap servlet request with MultipartRequestWrapper!";
+            LOG.error(message, e);
+            throw new ServletException(message, e);
+        }
         du.prepare(request, response);
 
         ActionMapper mapper = ActionMapperFactory.getMapper();
@@ -194,19 +204,11 @@
 
 
         Object o = null;
-        ServletContext servletContext = filterConfig.getServletContext();
         try {
 
             setupContainer(request);
             o = beforeActionInvocation(request, servletContext);
-
-            try {
-                request = du.wrapRequest(request, servletContext);
-            } catch (IOException e) {
-                String message = "Could not wrap servlet request with MultipartRequestWrapper!";
-                LOG.error(message, e);
-                throw new ServletException(message, e);
-            }
+            
             du.serviceAction(request, response, servletContext, mapping);
         } finally {
             afterActionInvocation(request, servletContext, o);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org