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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTTP Response" Watch "HTTP Response" New topic
Author

HTTP Response

Nit Kul
Greenhorn

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?

Thanks
Ulf Dittmer
Marshal

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


Ping & DNS - my free Android networking tools app
Nit Kul
Greenhorn

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
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Check again--and remember, this is Java, and has inheritance.
 
Don't get me started about those stupid light bulbs.
 
subject: HTTP Response