views:

15

answers:

1

I have a spring web application running on JBoss which is creating a csv file containing a report. The application must provide a link to the report when it finish its generation, and the user should be able to download it.

I am thinking to write the file directly inside the war, so then we could read it from the web application. But I have some problems to figure out a relative path to write the file in the correct place.

The default path where the file is written is /bin directory in the Jboss application server folder.

Which could be the best way to achieve this?

A: 

I discourage you from trying to do this - writing files into the internals of JBoss is liable to give unpredictable results, depending on the specific setup of the server.

Instead, I suggest writing the file to a temporary location on the filesystem, independent of JBoss. Then, write a Spring MVC controller to service requests for the file.

skaffman