• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accept compresed requests in tomcat

 
alain martin
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
alain martin
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to send a lot of data in a GPRS line...

Any one can confirm it isn't possible?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gprs
http://en.wikipedia.org/wiki/General_Packet_Radio_Service

Yes I have the client
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the server application
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, but I hope tomcat had native support of it
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic