O'Reilly logo

Servlet & JSP: A Tutorial, Second Edition by Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13

File Download

A static resource, such as an image or an HTML file, can be downloaded by simply pointing the browser at 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. In 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required