[Logo]
Forums Register Login
JSP + creating file
Dear all,
I would like to know if it's possible to write a new file (saving it on the hard disk) with a JSP page and not only send the reponse to the browser's client.
By example, with this code, I present a XML file to the client's browser.

But what if I want to save it into a new "colloque.xml" file? Is it possible (I guess it is) but what methods shouls I use?
Thanks for your response,
Cyril.
OK. I just have to to get absolute file path to the file by calling getServletContext().getRealPath("/colloque.xml"); Then I use simple FileWriter to write the file.
Regards,
Cyril.
She still doesn't approve of my superhero lifestyle. Or this shameless plug:
ScroogeXHTML 7.1 - RTF to HTML5 / XHTML converter
https://coderanch.com/t/690611/ScroogeXHTML-RTF-HTML-XHTML-converter


This thread has been viewed 461 times.

All times above are in ranch (not your local) time.
The current ranch time is
Feb 21, 2018 00:35:38.