I don't know of any direct way of doing what you are asking for. Once I needed a similar thing, i.e. I needed a servlet to deliver dynamic excel files. So I mapped the servlet to a path like /excel/*, and then sent request to it with the URL /excel/Accounts.xls and then the servlet used to create the excel and send it to the client and is used to save with the name Accounts.xls...