File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes mime-mapping? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "mime-mapping?" Watch "mime-mapping?" New topic


kriti sharma
Ranch Hand

Joined: Feb 16, 2001
Posts: 160
i have read in the servlet spec that mime-mapping element is used to map an mime-type to an extension. but can someone please tell the need to use this element. give me one real scenario when it would be required to add this element to the deployment descriptor.
Shailesh Kini
Ranch Hand

Joined: Oct 17, 2001
Posts: 153
Hey Kriti,

Not sure if you totaly agree with me but this could be one of the scenarios that i faced before.

Mime-type is sent in the header by the webserver to tell the browser how to handle the reponse. On the webservers we had an entry xls and the application type was ofcourse microsoft excel. Now if you have multiple web applications on deployed on the same server and you just want you application to open the xls file with open office then changing the entry on the webserver will cause issues as it will affect other application too. Defining them in the web.xml file is local to your application only.

[ July 22, 2004: Message edited by: Shailesh Kini a.k.a SKini ]

Shailesh Kini.
Vicky Jain
Ranch Hand

Joined: Aug 02, 2003
Posts: 52
Hi Shailesh,

I think u are talking right...


SCJP1.4(96%)<br />A drop of ink can make millions think.
kriti sharma
Ranch Hand

Joined: Feb 16, 2001
Posts: 160
shailesh, i cud not understand your point, cud you please try to explain once again?
I agree. Here's the link:
subject: mime-mapping?
It's not a secret anymore!