We now have several j2ee programs (e.g. A.ear, B.ear, C.war) running in one jboss instance, you will find there's requirement to talk about some static files across these programs. And So I ought to be capable of access these files as http://myhost/folderA/fileA.htm or http://myhost/folderB/file.js from inside my ear or war files.

How must i tell the jboss appserver (5.1.) to search for these files, how must i deploy this static content during my server/default/deploy directory or even the paperwork folder

If you are using jboss using the Jetty server, you are able to re-make use of the org.mortbay.jetty.servlet.DefaultServlet. I am certain tomcat has such like or just add the jetty one (since it is a servlet, it'll operate on any servlet container). Despite the fact that it's relatively simple to create it yourself, it isn't because you will find a lot of things an excellent implementation needs.

Have a look in the documentation from the DefaultServlet regarding how to configure it, it's many features.

You need to have the ability to put the static files in a single location and also have all of your contexts (A, B, C,...) possess a servlet that serves these static files.

If you're able to configure it to appear within the right folder, you might have the ability to reuse a current servlet like DefaultServlet. Or else you may code your personal servlet for everyone static content: I remember when i authored one here.