-
1. Re: allowing users to access server-created files
peterj Jul 30, 2007 3:53 PM (in response to wesomon99)Here is one possibility that comes to mind. Deploy your app exploded (). With the exploded directory, have a directory (for example, csv) and place the generated file there, then generate a web page with a link to the generated file: csv/tempfilename.csv. The user clicks the link to get the file.
Another possibility is to, within your servlet, change the content type on the ServletResponse to be "text/plain" (not sure if "text/csv" is valid, you could try it) and set the response content to be the csv file contents. -
2. Re: allowing users to access server-created files
wesomon99 Jul 30, 2007 5:47 PM (in response to wesomon99)I have deployed my application exploded, which worked fine. However, I can't create a file within the web file structure. The path .../myproject/csv/example.csv does not work, it gives me an error of no such file or directory even though the directory is definitely there.
-
3. Re: allowing users to access server-created files
peterj Jul 30, 2007 5:51 PM (in response to wesomon99)Are you using the getRealPath method of the ServletRequest or ServletContext to convert the relative path to a real path? If not, the path is calculated based on the current working directory, which is typically jboss_home/bin.
-
4. Re: allowing users to access server-created files
wesomon99 Jul 31, 2007 3:29 AM (in response to wesomon99)No I didn't know about that method. Thank you for the tip I will try that tomorrow.