• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Open .csv file within jsp

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have a .csv file being created be back end in server. I am trying to open this file within jsp in Excel. I could display .xsl file in JSP by changin the content type attribute of page directive. But I could not find the way do following in jsp: 1)read this .csv file. 2)open the excel. 3)open this file in Excel. Your prompt response is highly appriciated. Thanks in advance
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which content type did you try for CSV?
If I remember correctly, you should use something like "application/csv" instead of "text/csv".
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's what I do:
<%@page contentType="text/x-csv" session='true' errorPage='error.jsp'%>
and then, after I have set a variable up as a filename for download purposes,
<%response.setHeader("Content-disposition","filename=" + type + ".csv"); %>
This ensures that the client gets a "save or open" prompt, and provides the save case with a default filename.
[ April 22, 2003: Message edited by: Philip Shanks ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic