You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mieke Banderas <mi...@gamebox.net> on 2005/03/01 00:39:11 UTC

Re: Problems loading external stylesheet in Tomcat

Allistair Crossley said:

>Tomcat doesn't care or know about stylesheets. Your resultant HTML should
>contain references to stylesheets thus:
>
><link rel="stylesheet" href="/the/styles.css" />
>
>This gets spat out as HTML (which it is) and the browser takes care of
>linking them in. 
Well, this is how I have linked them already. I'm not sure why you
thought otherwise? Actually you can link them without the closing "/",
but I've used both.

However, you're assuming wrong that Tomcat doesn't need to know about
stylesheets to serve them properly. Prior to me adding the lines:
<mime-mapping>
    <extension>css</extension>
        <mime-type>text/css</mime-type>
    </mime-mapping>

to "conf/web.xml" Tomcat 3.2.4 wouldn't serve my stylesheets as "text/
css", but as "text/plain", rendering them inoperative. A "text/css" mime
mapping is standard from Tomcat 4 and onwards. I 'd suspect Tomcat 5 also
would stop serving stylesheets as "text/css" if you removed that mapping.

Anyway, my problem was that the stylesheets didn't take effect on the
first load, only once every day or so, then even for the first load in
any browser on any computer, indicating some kind of server problem.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org