Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Download CSV file from apllication server

Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have created a csv file in the weapps/csv directory. now my problem is i want to download that csv file from a jsp page by giving a link.

i don't want to hard code the server path , is there anyway i can do that

the application server i am using is tomcat. Just by clicking the link the csv file shd download
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use the properties file for this.
Read the property with help of ResourceBundle from the file and use it to make the link.

If your server changes you just need to change value of that variable in the property file.
Posts: 43016
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat will not serve files that are inside the WEB-INF directory, so you will need to create the file somewhere outside of it in a publicly accessible directory, or write a download servlet that reads the file in WEB-INF and streams it to the client for you.
We find this kind of rampant individuality very disturbing. But not this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic