title: Spring MultiPartResolver is manipulating other upload methods
body: <p>I am trying to merge two Spring based projects into one but I am having an issue with MultiPartResolver. Inside my merged application there are two classes that use uploaded POST methods using different upload methods. 
  One uses the HttpServletRequest to retrieve the uploaded file :</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.POST)
  public @ResponseBody void  handleResult(HttpServletRequest request,
          HttpServletResponse response)
  </code></pre>
  
  <p>and the other uses MultipartFile to get the file and another field called notes which is passed to the form:</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.POST)
  public @ResponseBody String handleFormUpload(@RequestParam("notes")
      String notes, @RequestParam("file") MultipartFile file)
  </code></pre>
  
  <p>The code then references 'file' to process the uploaded file.</p>
  
  <p>The problem I have is the MultipartFile class requires this in the applicationContext.xml:</p>
  
  <pre><code>    &lt;bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"&gt;
      &lt;property name="maxUploadSize" value="250000000"/&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>When this is in the applicationContext.xml file the original Servlet based method of posting fails. The POST request reaches this class but the file seems to have been stripped out as it processes it. As soon as I comment this out of the applicationContext.xml, the servlet method works again. However, the section of the code that uses the MultipartResolver now fails!</p>
  
  <p>I do not have much experience of Spring but I'm trying my best to do this. I cannot work out how to prevent CommonsMultipartResolver from manipulating the POST files that are destined for the Servlet based class.
  Can anybody help me?</p>