A static resource, such as an image or an HTML file, can be downloaded by simply pointing the browser to the right URL. As long as the resource is located in the application directory or a subdirectory under it and not under WEB-INF, the servlet/JSP container will send the resource to the browser. However, sometimes a static resource is stored outside the application directory or in a database, or sometimes you want to control over who can see it and prevent other websites from cross-referencing it. If any of these scenarios applies to you, then you have to send the resource programmatically.
In short, programmatic file download lets you selectively send a file to the browser. This chapter explains what it takes ...