title: Downloading file from Spring controller and return String
body: <p>I've read a couple of ways to download a file from a Spring Controller methods, either returning a FileSystemResource or void and using the outputStream. 
  What I want is to return a String because I want to validate the user input first. Something like...</p>
  
  <pre><code>public String downloadFile(BindingResult result, RedirectAttributes attr, ...) {
      if(result.hasErrors()) {
          ....
          return "redirect:/showForm";
      }
      ...
      return "success";
  }
  </code></pre>
  
  <p>is it possible? What alternatives do I have to do this? Thanks </p>