tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alireza Fattahi <afatt...@yahoo.com>
Subject JSP in Static Resources
Date Sat, 13 Jul 2013 07:20:31 GMT
Hi,

I want to add some jsp code in to my site.css.

So, as this is a static resource I add below to my web.xml and ask tomcat to compile it as
a jsp.
    <servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.css</url-pattern>
    </servlet-mapping>


When I view the site in firefox it shows an error which says:
[11:46:41.547] The stylesheet site.css was not loaded because its MIME type, "text/html",
is not "text/css". @ chrome://fdm_ffext/content/fdm_brcache.js:86

 
I have added below to web.xml
        <mime-mapping>
        <extension>css</extension>
        <mime-type>text/css</mime-type>
    </mime-mapping>    

It did not helped. The site pages link to css as below:
<link href="/styles/site.css"   rel="stylesheet" type="text/css" />


When I remove the servlet mapping and mime-mapping everything works fine. So I believe the
mime type is not set correctly for css files.
Any comments ?!


~Regards,
~~Alireza Fattahi
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message