• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP + creating file

 
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic