Dave Tolls wrote:First, not sure why you are saving the file on the server.
Probably because it was easier to construct the content as a temporary file and then copy the file contents to the output stream.
It's an Apache POI Workbook.
There's no need to do anything other than stream it directly to the client.
I don't think I've ever stored a POI generated Excel "file" to disk in a webapp other than for testing purposes.
It is not showing any error. It is not downloading in the web browser.
I don't want to save the file in server . Just for check the excel generated part is working or not , I generate and save locally. Actually I want to download the file at client browser..
My doubt is
this line is ok ? I am new to this JSF and how it is handling request and response . Here we are using spring bean to pass to and fro from client to server . To send response back I use above line ? Is ti correct way ?
You don't want JSF to handle the Excel stuff. JSF is designed to work with HTML forms and fixed displays. JSF puts its own headers into the response stream and it has a different lifecycle than JSPs do.
What you want is a plain old servlet. That way you have total control over what gets output and when. JSF doesn't mind sharing a webapp with servlets and JSPs, so that's no problem.
Blitzlügen - Lies or information broadcast, but when called out the broadcaster does little or nothing is done to correct them, thus allowing those who wish to believe to accept them as truth.
Lügensturm - A barrage of Blitzlügen fired in such quick succession that it is essentially impossible to correct them all.