wood burning stoves 2.0*
The moose likes Servlets and the fly likes HTTP Response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP Response" Watch "HTTP Response" New topic

HTTP Response

Nit Kul

Joined: Oct 26, 2009
Posts: 14
I am applying some filter on all response to the requests coming to my web server.
I need to apply this filter only on the responses of the type "text/html".

How can i check the content type to be text/html on the response object?

Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42913
Does none of the methods of the HttpServletResponse class suggest itself to find out the content type?
Nit Kul

Joined: Oct 26, 2009
Posts: 14
I could not find any api methods for response object. i.e. response.getContentType().

Thanks for the reply.

David Newton

Joined: Sep 29, 2008
Posts: 12617

Check again--and remember, this is Java, and has inheritance.
I agree. Here's the link: http://aspose.com/file-tools
subject: HTTP Response