• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mime-mapping in web.xml

 
Gab Buda
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would we configure the mime types in the web.xml?
Where and at which time this information is used? And who uses it? (the pair mime-type/extension) ?

(I found nothing about in the specs... )

Thank you
 
Liju Cherian
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When serving static resources, Tomcat will automatically generate a "Content-Type" header based on the resource's filename extension, and mime type mapping specified in the web.xml file.
For example -

<mime-mapping>
<extension>css</extension>
<mime-type>text/css</mime-type>
</mime-mapping>


Hope this answers your query.


Liju
 
Gab Buda
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Liju
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic