title: make document available for download through java/servlet
body: <p>I need to know if there is a way in java/servlet to make documents(doc,pdf) stored in database available for download to users in requested way(please see below), </p>
  
  <p>for example there is a web page and the link for document in it</p>
  
  <p><strong>right now it is done this way:</strong>
  if the user clicks that link than a new blank window opens and there the download dialog box is shown and the user is able to download the document but that blank window stays open
  and the user have to close it manually</p>
  
  <p><strong>but wish to do it this way:</strong>
  If the User clicks that link than directly staying on that page a download dialog box should show up asking them to save the file</p>
  
  <p>a servlet url handles the download of the document which is responsible for extracting the doc form database and makes available for download to users</p>
  
  <p>thank you for your time and effort</p>