Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GZip encoding in JSPs

 
Sajee Joseph
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I am aware of the usage of GZip format.
I know that i can use this for of encoding to compress the data sent to the browser provided the browser understands this format).
I achive this by writing the code in the service() method of my servlet.
How can i achive this if i use jsps instead of my servlets (Assuming that i have no servlets). Is writing the Filter for Compression the only way out??
Regards,
Sajee
 
brad balmer
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two best methods:
1. Writing a filter
2. If you use Apache, enable the gzip module and let apache do it for you.
 
Brahim Bakayoko
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by brad balmer:
There are two best methods:
1. Writing a filter
2. If you use Apache, enable the gzip module and let apache do it for you.

correct...
I prefer using a filter even when using tomcat. I have written a better logic to determine if the client can accept gzip or not and send them the appropriate output.
[ March 29, 2004: Message edited by: Brahim Bakayoko ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic