aspose file tools*
The moose likes Servlets and the fly likes Static constants for content type? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Static constants for content type?" Watch "Static constants for content type?" New topic
Author

Static constants for content type?

Lance Miller
Greenhorn

Joined: Jun 23, 2008
Posts: 21
In the Servlet API, are there any static constants for setting the content type? I've never found them. I created a class for such but wanted to make sure I just wasn't missing them from somewhere else.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

Not in the Servlet API. I don't know if standard MIME types are defined in any other API.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Lance Miller
Greenhorn

Joined: Jun 23, 2008
Posts: 21
Thanks Bear. I did find a ContentType class in the Google Data Protocol project. So it'll cost me a 974KB JAR file to use that. Not too bad. And it looks like it adds some nice additional utils & features.
Mariusz Zacny
Greenhorn

Joined: Apr 11, 2013
Posts: 1
You can use Spring 3 http://static.springsource.org/spring/docs/3.1.x/javadoc-api/org/springframework/http/MediaType.html

Represents an Internet Media Type, as defined in the HTTP specification.
 
wood burning stoves
 
subject: Static constants for content type?