File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes JSP + creating file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "JSP + creating file" Watch "JSP + creating file" New topic
Author

JSP + creating file

cyril vidal
Ranch Hand

Joined: Jul 02, 2003
Posts: 247
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.


SCJP 1.4, SCWCD, SCBCD, IBM XML, IBM Websphere 285, IBM Websphere 287
cyril vidal
Ranch Hand

Joined: Jul 02, 2003
Posts: 247
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.
 
GeeCON Prague 2014
 
subject: JSP + creating file