Where to generate and store temporary files?
My managed bean will generate PDF based on the user inputs. These PDFs are temporary, it is only valid for one specific request. I'm wondering where is the correct directory I should generate these PDFs ...
Currently, I'm generating these PDFs to C:\glassfish3\glassfish\domains\domain1\applications\myapp like this:
ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
// path is C:\glassfish3\glassfish\domains\domain1\applications\myapp
String path = context.getRealPath("/");
File temp = new File(path, "summary.pdf");
Is there a better place to store temporary files?