• 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

Getting file path for webservice project

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Glassfish, and am attempting to write files to disk from a web application.

Unfortunately the file is written directly to the Glassfish server directory ("C:\...\.netbeans\7.0\config\GF3\domain1")
and not to my project directory (which is where I want it to be saved to).

For Servlets, I got around this problem, using the following method:
String filepath = getServletContext().getRealPath("/");

But for my web service, I cannot use this method, and am struggling to find one which would work.
Does anyone know of a method which might help?

Thanks very much


 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic