
In this Tutorial i'm going to explain how you can serve files to your users using JSP. Since we are not serving a HTML page so first we need to tell the browser that what kind of data we are going to serve for that we set Response Headers
response.setContentType("application/msword"); response.addHeader( "Content-Disposition","attachment; filename=your file name" );
Here application/msword is the mime type you can search internet for diff. mime type required for diff. extensions few commonly used are
image/jpeg
text/plain
application/pdf
link format for filedownload
<a href="download.jsp?filename=myresume.doc">Download...