On 7/13/2013 10:56 PM, Alireza Fattahi wrote:
> Guys please concentrate on the main issue !!
>
> I ask again:
>
> When you set jsp servlet to process the css files by adding:
> <servlet-mapping>
>     <servlet-name>jsp</servlet-name>
>     <url-pattern>*.css</url-pattern>
> </servlet-mapping>
>
>
> The tomcat does not set the CSS file extension mime type to text/css. 
> Although below line is set in localhost-config/web.xml
>
>     <mime-mapping>
>         <extension>css</extension>
>         <mime-type>text/css</mime-type>
>     </mime-mapping>
>
>
> When you manually set the content mime type <%@page contentType="text/css" %> 
> every thing will work fine
>
>
> ~Regards,
> ~~Alireza Fattahi


For Tomcat 6, using the contentType attribute of the page directive
doesn't seem all that objectionable to me.  response.setContentType()
could also be used.  For Tomcat 7, I agree that Konstantin Kolinko
provided a very straightforward solution in an earlier post.  If I
remember correctly, he also pointed out that MIME mappings in web.xml
are only used for static content.

In addition, if the dynamically generated CSS is only used to import
static CSS files, you might consider generating link elements in the
HTML document instead.  Assuming the HTML is dynamically generated, this
would eliminate the caching problem Tim Watts pointed out and I believe
would provide better performance on the client side.

-Terence Bandoian


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to