Can you please tell me instead of file name as javaQuery.jar why it is prompting to save as servlet name.
It is actually prompting to save the selectCoffee.do because of the servlet mapping. The browser only knows that you are doing a GET request to the URL http://localhost:8080/ResponseDemo/selectCoffee.do and sees that it is returning a file (because of the content-type). The browser has no knowledge of the fact that the Servlet in the web-container is actually returning a .jar file.
I was also facing the same issue. 'response.setHeader( "Content-Disposition", "attachment; filename=javaQuery.jar" )' - this line worked for me and I am now able to download jar instead of *.do file, I don't know how it works though.
There is no greater crime than stealing somebody's best friend. I miss you tiny ad:
Devious Experiments for a Truly Passive Greenhouse!