开发者

What is the MIME type for properties files?

开发者 https://www.devze.com 2023-03-11 03:00 出处:网络
What is the MIME type for properties file? Here is a list of all the files with different extensions but here I could not see any MIME type for the properties file.

What is the MIME type for properties file?

Here is a list of all the files with different extensions but here I could not see any MIME type for the properties file.

Mime Types

I have a properties file in my scripts folder and I am trying to read it in another scripts. When run as simple HTML file and a script file it works properly but开发者_运维百科 when I put it in my web application which uses Spring MVC, its not able to read the properties file.

The error I get is

No media type found for ServletContext resource [Messages_en.properties] -returning 404.

Please help.


Commonly used is text/x-java-properties. E.g. project MoinMoin uses that.


According to Apache HTTPd's Mime type list which is probably the most extensive you can find, there is no definition for properties files.

It's not clear to me what you're trying to achieve, but generally text/plain works well with properties files.


According to IANA Media Types which is the most authoritative source, there is no standard MIME type for Java Properties files.

Apache HTTPD / Subversion MIME type lists (which are referenced in other answers as the one from @nico) are simply a copy of IANA's.

RFC2046 specifies that Media Types (formerly known as MIME types) and Media Subtypes will be assigned and listed by the IANA. (Source IANA Media Types)

Anyway, I've to agree with @Ondra Žižka that a few non-authoritative - but relevant - sources (like Trac and CaCert.org, for instance) are seemingly converging onto the text/x-java-properties type, which is correctly using the `x-' prefix.

There is not a dozen places where this MIME type is used, though.

0

精彩评论

暂无评论...
验证码 换一张
取 消