Thanks everyone for your help.
Well, I should have mentioned the following :
1) the application is based on Spring Web flow so there is a form action method which is called when the user clicks on the CSV button
That method stores the file in the flow scope :
2) there is a servlet which is called and which sends the file to the client (browser). It is the code that I already mentioned :
So it is working on IE 11/ Edge but not on Firefox.
What kind of works is if i add the the following code inside the form action method :
But of course i get the following error when Spring Web flow tries to render the view (JSP) since the response was already sent :