Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Nikola Legrand
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic