During development I want to serve static JSON files to my AJAX application. Serving it from an Apache web server on the same server URL but different port number (different from my Tomcat port number) gives me a same origin policy error in Firefox (though not IE). To get around this quickly, I thought I'd serve static content from Tomcat itself, using the same port. But how?
I've Googled on this and read the Tomcat FAQs and even JBoss FAQs on serving static content from Tomcat. All of them say it's slow and you wouldn't want to do it, and to proxy to your Apache web server instead. I don't want to do that, for various reasons, but if I have to, I will. The closest I've found to a technique for serving static content from Tomcat is at: http://wiki.jboss.org/wiki/ExternalDirectories Here is the relevant part of that link: BEGIN >> Serving Static External Files in standalone Tomcat Instances (not the Tomcat instance bundled with JBoss) If you wish to serve static content from a directory external to webapps, you can add "Context" element to the Host element in the server's "server.xml" <Host name="localhost" ...> <!-- ADD static benchmark DIRECTORY --> <Context path="/benchmark" appBase="" docBase="/home/anil/benchmark" debug="99" reloadable="true"> </Context> ... </Host> This will enable Tomcat to serve up static content (like html, images etc) from a directory /home/anil/benchmark and the url will be http://localhost:8080/benchmark << END I tried a few permutations of this late Friday with no success. (1) Is it possible to serve static content with Tomcat? (2) Is the JBoss example above sufficient? Should I persevere with it? (3) Is there a Tomcat FAQ or other document that I have completely missed that explains all? Any assistance would be very much appreciated! Regards, Mal. --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]