aspose file tools*
The moose likes JSP and the fly likes Download CSV file from apllication server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Download CSV file from apllication server" Watch "Download CSV file from apllication server" New topic
Author

Download CSV file from apllication server

felix thomas
Ranch Hand

Joined: Jun 10, 2001
Posts: 89
Hi,

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
Amol Fuke
Ranch Hand

Joined: Apr 08, 2005
Posts: 129
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.


"There are no mistakes, only lessons"
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41523
    
  53
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.


Ping & DNS - my free Android networking tools app
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Download CSV file from apllication server