title: How to implement file download with Spring MVC in Java?
body: <p>There is a lot upload examples, but I couldn't find any for download. I'm using Spring 3.0 and I need to generate some text buffer and then let user download it as a file. (There is no static resource.)</p>
  
  <p>So far I've tried to use <code>@ResponseBody</code> and writing to response output stream. In both cases browser display content of the 'file' instead of showing Save dialog box. How do I make browser display a dialog box?</p>
  
  <p>Thanks.</p>