I am rather new to Tomcat and only a little more experienced in the ways of JAVA. My windows application needs to access WAV files via HTTP. I would like to access files in say... "C:/prompts" on my server "//10.20.30.40:8080" for example. How do I make this path visible via HTTP? Is there a configuration file with which I can point to my virtual directory so that the URL becomes something like: "http://10.20.30.40:8080/Prompts"?
The simplest way would be to merely include copies of the wav files as part of your WAR and not attempt to kludge around things.
Relocating the entire WAR (as Ulf suggested) probably wouldn't do what you wanted, since the ENTIRE war has to be relocated, but depending on how things are set up, it might be a possibility.
Windows added a file aliasing feature similar to Unix/Linux softlinks a few years back, and this can be used to make the WAV directory appear to be part of the WAR, although you may have to change some settings in server.xml, since softlinks are somewhat of a security issue and thus disabled by default.
And then there's the old standby: write a servlet that copies the WAV from its actual external home out to the HttpResponse output stream (which is what the default servlet does for in-WAR files anyway).
An IDE is no substitute for an Intelligent Developer.
Joined: Mar 22, 2005
Tim Holloway wrote:Relocating the entire WAR (as Ulf suggested) probably wouldn't do what you wanted, since the ENTIRE war has to be relocated
Actually, what I meant -but didn't say explicitly- was to create a second web app that would do nothing but serve files from this directory. I agree that moving the entire web app would likely not be a practical approach.