• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

NFS access from a J2EE Tomcat app, how do they work

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to everyone,

(please forgive my english)

I'm working on a J2EE web application . For its need, some resources (xml files) had to be shared. The use of these resources could be loading xml file via javascript, of parsing XML within a servlet.
These resources have been put in a folder which is NFS shared. This folder has been mounted on the app's server, above the app's folder, at server's root.

In the Tomcat server.xml conf file, i added a Context with Docbase="/nfsFolder" and Path="/nfsFolder". Then, i was able to load a file from javascript as follow : "obj.load("/nfsFolder/myFile.xml").

- First of all, i would like to understand what happens the moment the javascript interprets the path "/nfsFolder/myFile.xml". This path cannot lead to a folder, in a file system logic. There is no such folder at js's level.
So, as it is actually working, i guess the js interprets this path relatively to the Tomcat's configuration. And that's makes few sense to me. Can someone give me keys to understand what *really* happen ?

- Secondly, i 'm wondering if i will be able to protect these XML file from direct access from a browser (i'm thinking about setting a htaccess)... What do you think ?

I hope you will forgive the imprecise nature of my questions

Thanks for having read
Nikola Legrand
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh god. I'm so sorry... I just told random things, i didnt' have a clue. All this is new for me, i dont know about NFS and tomcat conf neither.

First of all, javascript *cant* access folders on server or client filesystem. That was completely dumb to think so.

Secondly, the fact that the folder is NFS shared has nothing to do with what happens.

Simply put, i have loaded files on a web server, and the code in the .js makes a http access to a file.

There is nothing more to understand.
Thanks for your attention
    Bookmark Topic Watch Topic
  • New Topic