File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Precompression hates me 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 "Precompression hates me" Watch "Precompression hates me" New topic

Precompression hates me

Thomas May

Joined: Nov 26, 2012
Posts: 2
I'm using GWT with tomcat 6 and 7. I've tried writing a filter to forward things if the requested content + ".gz" exists. That works, except for the fact that the requestDispatcher will commit the request and set the content type to application/x-gzip

How do I fix this?

Here is my current code

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12678
The Tomcat default web.xml includes the following:

which, as I understand it, controls the way the default servlet sets content type when serving resources.


Java Resources at
I agree. Here's the link:
subject: Precompression hates me
Similar Threads
Tomcat servlet-mapping bypass if real file requested
Compression Filter
Access Response Status From Filter
Exception: Server redirected too many times (20)
JSP with large data loads slow in Solaris10 OS , we are using Jrun4 and nested logic:iterate