mschachter    01/06/13 10:07:57

  Modified:    src/share/org/apache/struts/action Tag: STRUTS_1_0_BRANCH
                        ActionServlet.java
  Log:
   - fix wrapped request issues in 1.0 branch
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.68.2.2  +18 -6     
jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java
  
  Index: ActionServlet.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
  retrieving revision 1.68.2.1
  retrieving revision 1.68.2.2
  diff -u -r1.68.2.1 -r1.68.2.2
  --- ActionServlet.java        2001/06/02 23:06:49     1.68.2.1
  +++ ActionServlet.java        2001/06/13 17:07:55     1.68.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v 
1.68.2.1 2001/06/02 23:06:49 craigmcc Exp $
  - * $Revision: 1.68.2.1 $
  - * $Date: 2001/06/02 23:06:49 $
  + * $Header: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v 
1.68.2.2 2001/06/13 17:07:55 mschachter Exp $
  + * $Revision: 1.68.2.2 $
  + * $Date: 2001/06/13 17:07:55 $
    *
    * ====================================================================
    *
  @@ -230,7 +230,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.68.2.1 $ $Date: 2001/06/02 23:06:49 $
  + * @version $Revision: 1.68.2.2 $ $Date: 2001/06/13 17:07:55 $
    */
   
   public class ActionServlet
  @@ -1828,7 +1828,11 @@
           String forward = mapping.getForward();
           if (forward == null)
               return (true);
  -
  +        
  +        //unwrap the multipart request if there is one
  +        if (request instanceof MultipartRequestWrapper) {
  +            request = ((MultipartRequestWrapper) request).getRequest();
  +        }
           // Construct a request dispatcher for the specified path
           RequestDispatcher rd =
               getServletContext().getRequestDispatcher(forward);
  @@ -1870,6 +1874,10 @@
           if (include == null)
               return (true);
   
  +        //unwrap the multipart request if there is one
  +        if (request instanceof MultipartRequestWrapper) {
  +            request = ((MultipartRequestWrapper) request).getRequest();
  +        }
           // Construct a request dispatcher for the specified path
           RequestDispatcher rd =
               getServletContext().getRequestDispatcher(include);
  @@ -2125,8 +2133,12 @@
   
        // Save our error messages and return to the input form if possible
        if (debug >= 1)
  -         log("  Validation error(s), redirecting to: " + uri);
  +         log("  Validation error(s), redirecting to: " + uri);        
        request.setAttribute(Action.ERROR_KEY, errors);
  +        //unwrap the multipart request if there is one
  +        if (request instanceof MultipartRequestWrapper) {
  +            request = ((MultipartRequestWrapper) request).getRequest();
  +        }
        RequestDispatcher rd = getServletContext().getRequestDispatcher(uri);
           if (rd == null) {
               response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
  
  
  

Reply via email to