aspose file tools*
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
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: 42608
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

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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: HTTP Response