aspose file tools*
The moose likes Servlets and the fly likes GZip encoding in JSPs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "GZip encoding in JSPs" Watch "GZip encoding in JSPs" New topic
Author

GZip encoding in JSPs

Sajee Joseph
Ranch Hand

Joined: Jan 17, 2001
Posts: 200
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

Joined: Mar 08, 2004
Posts: 57
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.
Sean Sullivan
Ranch Hand

Joined: Sep 09, 2001
Posts: 427
1) http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html
2) http://jodd.sourceforge.net/javadoc/jodd/servlet/filters/GzipFilter.html
Brahim Bakayoko
Ranch Hand

Joined: Aug 29, 2003
Posts: 155
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 ]

SCJP, SCWCD, SCBCD, IBM CSD WebSphere v5, <br />A+, MCP 2000 and 2000 server, CST, and few incompleted certification tracks.<br /> <br />Ivory Coast<br /> <br />Analyze your web Request/Response @ <a href="http://webtools.servehttp.com" target="_blank" rel="nofollow">http://webtools.servehttp.com</a> down for a while...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: GZip encoding in JSPs