Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Static constants for content type?

 
Lance Miller
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64700
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not in the Servlet API. I don't know if standard MIME types are defined in any other API.
 
Lance Miller
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic