I've just got to the bottom of a fairly obscure problem that occurs when using Mozilla Firefox to access a web application developed using Oracle JDeveloper. The JSPs in my application link to an external stylesheet, but the pages weren't styled when viewed using a Gecko-based browser, such as Firefox. However, they were fine when using Internet Explorer or Opera.
Changing to an inline stylesheet declaration fixed the problem, which suggested that there might have been something about my external stylesheet declaration that Firefox didn't like:
<link rel="stylesheet" type="text/css" href="/webforum/assets/css/webforum.css" />
—This opened up another avenue of investigation. JDeveloper includes a cut-down, embedded version of Oracle's OC4J J2EE application server. This enables J2EE components and web applications to be run from within the IDE. I know that OC4J uses Apache as its web server, which led me to suspect that I was dealing with an Apache configuration problem and not a JDeveloper or OC4J problem. I sniffed around in the configuration directory for the embedded container and found a file named mime.types, which seemed a likely candidate for modification. I added the line:
…restarted the application and all was now well. I could admire the results of my beautiful stylesheet in Firefox and marvel at how different it looked from IE.
According to a message on the Oracle Technology Network JDeveloper forum, this quirk is still present in the latest JDeveloper release. For the benefit of other developers with this problem who want to work around it, simply download this mime.types file from my standalone Apache 1.3 installation and overwrite the existing file in:
—for the embedded OC4J server, or:
—for the standalone server. Job done!