On 15/07/2013 08:03, Alireza Fattahi wrote:
> Thanks for help!
> 
> Let me summarize:
> 
> There are two servlets as below:
> 1- Default servlet which process all static resources
> 2- jsp servlet which process the JSP file
> 
> The mime types ( which are defined in localhost-config/web.xml) are only used 
> bydefault servlet.
> 
> 
> When I ask the jsp servlet to process the .css files, this servlet will 
> always set the MIME to text/html.
> 
> So this problem could be solved  if the servlet mapping has something like 
> mime-type as below:
> <servlet-mapping>
>     <servlet-name>jsp</servlet-name>
>     <url-pattern>*.css</url-pattern>
>    <mime-type>text/css</mime-type>
> </servlet-mapping>
> I should ask jcp.org to put this in next servlet jsr !!

You'd be wasting your time.

The specifications (Servlet 2.5, JSP 2.1) that Tomcat 6 is based on
aren't going to change.

The specification that Tomcat 7 is based on (Servlet 3.0, JSP 2.2)
already - as Konstantin has pointed out - contain a feature that let you
do effectively the same thing in web.xml.

The specifications that Tomcat 8 is based on (Servlet 3.1, JSP 2.3) are
now final and - as the specifications place a high importance on
compatibility - still contain the feature Konstantin told you about.

The work on the specifications that Tomcat 9 will be based on hasn't
started yet but as a member of one the expert groups that would consider
the proposal above I can tell you that my view would be to reject it as
unnecessary bloat.

> So, may be I try to write a servlet to set the content type.
> Do you know if tomcat has a build in filter or servlet for that.
> Some thing like: org.apache.catalina.filters.SetCharacterEncodingFilter which 
> sets the encoding

No, but it would be trivial to write one.

Mark


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

Reply via email to