Downloading excel file with diff name as jsp

Hi friends,

I need to download an excel file .The link for it is on jsp page. When the user clicks on download, the default filename that is displayed in the dialog box will be the same as my jsp page . I need to replace that name which I need to generate at runtime.I'm using POI API while writing into that excel file .

Pls provide me with solution ASAP.

Thanks

[390 byte] By [javaculturea] at [2007-9-24]
# 1

Hello,

I have used this piece of code to download pdf files:

download.jsp:

<%@ page contentType="application/pdf;charset=TIS-620" %><% response.setHeader("Content-Disposition","attachment; filename="+request.getParameter("id").substring(request.getParameter("id").lastIndexOf("/")+1));

%><jsp:include page='<%= "/WEB-INF/supporting-files/PDFs/"+request.getParameter("id") %>'/>

Hope you can adapt it to your needs. If its not clear, let me know.

Regards,

OO

orly_oteroa at 2007-7-16 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 2
Oh, BTW, I used this because not all pdf files are public for all users.
orly_oteroa at 2007-7-16 > top of java,Enterprise & Remote Computing,Web Tier APIs...