<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sean Cook &#187; J2EE</title>
	<atom:link href="http://www.seancook.com/tag/j2ee/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.seancook.com</link>
	<description>ramblings on mobile software, devices, and life</description>
	<lastBuildDate>Mon, 17 Aug 2009 15:40:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GZIP content for mobile devices</title>
		<link>http://www.seancook.com/2008/07/02/gzip-content-for-mobile-devices/</link>
		<comments>http://www.seancook.com/2008/07/02/gzip-content-for-mobile-devices/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 18:31:39 +0000</pubDate>
		<dc:creator>Sean</dc:creator>
				<category><![CDATA[Handsets]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[GZIP]]></category>
		<category><![CDATA[J2EE]]></category>

		<guid isPermaLink="false">http://www.seancook.local/?p=11</guid>
		<description><![CDATA[One of the easiest, most obvious ways to lower the data transfer footprint of your mobile apps is to compress data. For some reason, I still see mobile web decks that output XHTML-MP in plain text instead of very-easy-to-implement GZIP compression. I’ve implemented GZIP output on multiple J2EE projects with the help of Jayson Falkner’s [...]]]></description>
			<content:encoded><![CDATA[<p>One of the easiest, most obvious ways to lower the data transfer footprint of your mobile apps is to compress data. For some reason, I still see mobile web decks that output XHTML-MP in plain text instead of very-easy-to-implement <a href="http://en.wikipedia.org/wiki/Gzip">GZIP</a> compression. I’ve implemented GZIP output on multiple J2EE projects with the help of Jayson Falkner’s excellent GZIPFilter which is available in his article <a href="http://www.onjava.com/pub/a/onjava/2003/11/19/filters.html">Two Servlet Filters Every Web Application Should Have</a>.</p>
<p>To implement the filter in your own projects, download the three pieces of the filter: GZIPFilter, GZIPResponseStream, GZIPResponseWrapper and save them in your project. Then, in your web.xml add the following entries:</p>
<pre name="code" class="xml">
<filter>
<filter-name>Compress</filter-name>
<filter-class>GZIPFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>Compress</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
</pre>
<p>Remember to adjust the url-pattern to what’s appropriate for your webapp. I typically map my Spring MVC dispatcher servlet to *.do, but that’s just a hangover from Struts.</p>
<p>Once you’ve redeployed your webapp you should verify that output is rendering correctly in a desktop client such as Firefox.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.seancook.com/2008/07/02/gzip-content-for-mobile-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
