• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Can I write to a directory outside the j2ee container?

Posts: 9099
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want my servlet to write to the equivalent of C:\store, however, because I'm using Linux, I want to write to /store. I have tried adding
<virtual-directory virtual-path="/store" real-path="/store/" />
<virtual-directory virtual-path="/store" real-path="~//store/" />
<virtual-directory virtual-path="/store" real-path="/../../../../../store/" />
to {OC4J_HOME}/j2ee/home/application-deployments/myApp/myApp/orion-web.xml with no success. The webapp still tries to write to

Can I write outside the j2ee container?
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure to use the File class static fields separator and pathSeparator (or the char versions).
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can indeed, IF the application server allows it (many don't or can have file permissions outside the web application directory disallowed for security reasons).
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic