File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 39529
    
  27
Does none of the methods of the HttpServletResponse class suggest itself to find out the content type?


Ping & DNS - updated with new look and Ping home screen widget
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Response
 
Similar Threads
Default content-type
respnsce.setContentType()
Displaying an image in a servlet
How to Use bean:write inside html:text
How to force encoding of web browser to UTF-8