aspose file tools*
The moose likes Tomcat and the fly likes Accept compresed requests in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Accept compresed requests in tomcat" Watch "Accept compresed requests in tomcat" New topic
Author

Accept compresed requests in tomcat

alain martin
Ranch Hand

Joined: Apr 11, 2005
Posts: 43
I have tomcat configurate to send responses compresed with gzip if the cliente send me the Accept-encoding:gzip http header.

But how allow tomcat to accept compressed request with Content-encoding: gzip header?

Thanks


<a href="http://www.hhdirecto.net" target="_blank" rel="nofollow">http://www.hhdirecto.net</a>
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I don't think Tomcat has the capability to unzip request information.
What type of requests are you making that would be large enough to benefit from such capability?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
alain martin
Ranch Hand

Joined: Apr 11, 2005
Posts: 43
I have to send a lot of data in a GPRS line...

Any one can confirm it isn't possible?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by alain martin:
I have to send a lot of data in a GPRS line...

Any one can confirm it isn't possible?


What is GPRS?
Do you already have a client that can send compressed data?
[ October 25, 2007: Message edited by: Ben Souther ]
alain martin
Ranch Hand

Joined: Apr 11, 2005
Posts: 43
gprs
http://en.wikipedia.org/wiki/General_Packet_Radio_Service

Yes I have the client
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Do you already have the server application or is this something you're writing yourself?

In either case, it shouldn't be that difficult to implement this yourself by writing either a servlet filter or a Tomcat valve.
alain martin
Ranch Hand

Joined: Apr 11, 2005
Posts: 43
I have the server application
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12787
    
    5
Take a look in the java.util.zip package for classes that can handle GZIP encoding.

Seems to me a Filter that can look at the headers of an incoming request and substitute an unzipping InputStream when needed could be used without any modification to actual server code. There are plenty of filter examples around - but they mostly deal with zipping the output to the response.

Bill
alain martin
Ranch Hand

Joined: Apr 11, 2005
Posts: 43
Thanks, but I hope tomcat had native support of it
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Accept compresed requests in tomcat