Export File name in servlet/jsp
While giving a link for export as a file, you may also want to give it a name that should come in save-as dialog or browser. To do so, you have to just set Content-Disposition header and content type of response
e.g. for saving as an excel file, following can be used:
response.setHeader(“Content-Disposition”,”attachment; filename=”" + filename + “”"); response.setContentType(“application/vnd.ms-excel”);