tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeffrey Janner" <>
Subject RE: CSV File "Save as" dialogue defaults to HTM file
Date Mon, 25 Jan 2010 20:31:24 GMT
Ran -
I'm unfamiliar with Jetspeed, so take what I say next with a grain of
When you say "print a link to it", do you mean to say you add an <A> tag
to the resulting page with the appropriate path?  So the user is just
clicking on a regular html <A> link?
If so, then I would think adding a <mime-mapping> for the .csv extension
to your web.xml would be sufficient.  There is no mime-mapping for .csv
in the standard web.xml file distributed with Tomcat.
If instead your portlet/servlet is streaming the file (or anything more
complicated), then you'll need the advice of someone more technical than

-----Original Message-----
From: Ran Harpaz [] 
Sent: Monday, January 25, 2010 12:04 PM
Subject: Re: CSV File "Save as" dialogue defaults to HTM file

Alessandro Bahgat wrote:
> On Mon, Jan 25, 2010 at 11:02 AM, Pid <> wrote:
>> On 25/01/2010 09:17, Ran Harpaz wrote:
>>> Hello, I'm using Jetspeed 1.6, running on Tomcat.
>>> In a portlet I developed, I create a .csv file and print a link to
>>> The
>>> user then needs to right-click on the file and select "save file
>>> The dialogue that pops up defaults to file type HTML file, and
>>> the
>>> .csv extension of the file I link to with .htm.
>>> Is there anyway to resolve this? I really need to give access to the
>>> file as-is, and not bother my clients more than neccessary.
>> Are you setting the "Content-type" header to "text/csv", or are you
>> generating it with a JSP?
>> The latter will automatically set text/html as the content type.
> You may also want to change the content-disposition header in order to
> make your server prompt the user with the "save as" dialog:
> For example,
> response.setHeader("Content-disposition",
>                   "attachment; filename=" +
>                   defaultCsvFilename );
> Regards,
> Alessandro
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Thank you, but this solution doesn't seem to work on Jetspeed, due to
fact that I'm running JSR-168 Portlets on it. I don't believe they
changing the response's ContentType.

I wanted to know if there was anything about the Tomcat platform that
result in a CSV file defaulting to an HTM file, and if there was
anything to
do about it.
View this message in context:
Sent from the Tomcat - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

*******************************  NOTICE  *********************************
This message is intended for the use of the individual or entity to which 
it is addressed and may contain information that is privileged, 
confidential, and exempt from disclosure under applicable law.  If the 
reader of this message is not the intended recipient or the employee or 
agent responsible for delivering this message to the intended recipient, 
you are hereby notified that any dissemination, distribution, or copying 
of this communication is strictly prohibited.  If you have received this 
communication in error, please notify us immediately by reply or by 
telephone (call us collect at 512-343-9100) and immediately delete this 
message and all its attachments.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message