How to Download File using Servlet

Consider that I have file containing project information available into server and I want to download that file. Using webservices you can also achieve same but Here, I am going to discuss "Download File using Servlet"

Steps to be Performed to Download File using Servlet :
  1. Create Servlet File which will download file available in server
  2. Add Servlet entry into Web.xml or annotate with @WebServlet