aspose file tools*
The moose likes Tomcat and the fly likes NFS access from a J2EE Tomcat app, how do they work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "NFS access from a J2EE Tomcat app, how do they work" Watch "NFS access from a J2EE Tomcat app, how do they work" New topic
Author

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

Nikola Legrand
Greenhorn

Joined: Mar 27, 2011
Posts: 2
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
Greenhorn

Joined: Mar 27, 2011
Posts: 2
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: NFS access from a J2EE Tomcat app, how do they work