How can my servlet determine the appropriate MIME type to set in the response, based on the file extension of the file being sent?

swarraj kulkarni

There is no automatic way for the servlet to determine the MIME type as per the extension of the file being served to client.

In the servlet code you can have the swich kind of code where you can set the MIME type as per the file extension type.

Here is the link which specifies all the extension types and required MIME types: File Extensions and MIME types

[You could also try to parse your web.xml file... -Alex]
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact