<?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"
	>

<channel>
	<title>Matt's Blog</title>
	<atom:link href="http://blog.sutternow.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.sutternow.com</link>
	<description>All things Tech, Java, Linux, Family, Dogs, Cars(Subaru) with a little bit of nonsense mixed in</description>
	<pubDate>Wed, 03 Dec 2008 17:29:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>New topic for jeff</title>
		<link>http://blog.sutternow.com/blog/2008/12/new-topic-for-jeff</link>
		<comments>http://blog.sutternow.com/blog/2008/12/new-topic-for-jeff#comments</comments>
		<pubDate>Wed, 03 Dec 2008 17:29:12 +0000</pubDate>
		<dc:creator>mpayne</dc:creator>
		
		<category><![CDATA[A]]></category>

		<guid isPermaLink="false">http://blog.sutternow.com/blog/2008/12/new-topic-for-jeff</guid>
		<description><![CDATA[Here is my entry
]]></description>
			<content:encoded><![CDATA[<p>Here is my entry</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sutternow.com/blog/2008/12/new-topic-for-jeff/feed</wfw:commentRss>
		</item>
		<item>
		<title>Adding a hint to indicate links are external</title>
		<link>http://blog.sutternow.com/blog/2008/11/adding-a-hint-to-indicate-links-are-external</link>
		<comments>http://blog.sutternow.com/blog/2008/11/adding-a-hint-to-indicate-links-are-external#comments</comments>
		<pubDate>Thu, 27 Nov 2008 04:17:57 +0000</pubDate>
		<dc:creator>mpayne</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.sutternow.com/blog/2008/11/adding-a-hint-to-indicate-links-are-external</guid>
		<description><![CDATA[Good tip from &#8212; &#62;http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#more-103




$(document).ready(function() {


&#160; $(&#8216;#extlinks a&#8217;).filter(function() {


&#160; &#160; return this.hostname &#38;&#38; this.hostname !== location.hostname;


&#160; }).after(&#8216; &#60;img src=&#8221;/images/external.png&#8221; alt=&#8221;external link&#8221;&#62;&#8217;);


}); 





]]></description>
			<content:encoded><![CDATA[<p>Good tip from &#8212; &gt;<br /><a href="http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#more-103">http://www.learningjquery.com/2008/08/quick-tip-dynamically-add-an-icon-for-external-links#more-103</a></p>
<div id="javascript-1">
<div class="javascript">
<ol>
<li>
<div style="font-family: 'Courier New',Courier,monospace;font-weight: normal">$<span style="color: rgb(51, 51, 51)">(</span><span style="color: rgb(87, 153, 195)">document</span><span style="color: rgb(51, 51, 51)">)</span>.<a href="http://www.learningjquery.com/wp-content/themes/jquery/docs.php?fn=ready"><span style="color: rgb(173, 1, 0);font-weight: bold">ready</span></a><span style="color: rgb(51, 51, 51)">(</span><span style="color: rgb(34, 34, 34)">function</span><span style="color: rgb(51, 51, 51)">(</span><span style="color: rgb(51, 51, 51)">)</span> <span style="color: rgb(51, 51, 51)">{</span></div>
</li>
<li>
<div style="font-family: 'Courier New',Courier,monospace;font-weight: normal">&nbsp; $<span style="color: rgb(51, 51, 51)">(</span><span style="color: rgb(87, 153, 195)">&#8216;#extlinks a&#8217;</span><span style="color: rgb(51, 51, 51)">)</span>.<a href="http://www.learningjquery.com/wp-content/themes/jquery/docs.php?fn=filter"><span style="color: rgb(173, 1, 0);font-weight: bold">filter</span></a><span style="color: rgb(51, 51, 51)">(</span><span style="color: rgb(34, 34, 34)">function</span><span style="color: rgb(51, 51, 51)">(</span><span style="color: rgb(51, 51, 51)">)</span> <span style="color: rgb(51, 51, 51)">{</span></div>
</li>
<li>
<div style="font-family: 'Courier New',Courier,monospace;font-weight: normal">&nbsp; &nbsp; <span style="color: rgb(0, 108, 176);font-weight: bold">return</span> <span style="color: rgb(99, 151, 53);font-weight: bold">this</span>.<span style="color: rgb(99, 151, 53)">hostname</span> &amp;&amp; <span style="color: rgb(99, 151, 53);font-weight: bold">this</span>.<span style="color: rgb(99, 151, 53)">hostname</span> !== <span style="color: rgb(99, 151, 53);font-weight: bold">location</span>.<span style="color: rgb(99, 151, 53)">hostname</span>;</div>
</li>
<li>
<div style="font-family: 'Courier New',Courier,monospace;font-weight: normal">&nbsp; <span style="color: rgb(51, 51, 51)">}</span><span style="color: rgb(51, 51, 51)">)</span>.<a href="http://www.learningjquery.com/wp-content/themes/jquery/docs.php?fn=after"><span style="color: rgb(173, 1, 0);font-weight: bold">after</span></a><span style="color: rgb(51, 51, 51)">(</span><span style="color: rgb(87, 153, 195)">&#8216; &lt;img src=&#8221;/images/external.png&#8221; alt=&#8221;external link&#8221;&gt;&#8217;</span><span style="color: rgb(51, 51, 51)">)</span>;</div>
</li>
<li>
<div style="font-family: 'Courier New',Courier,monospace;font-weight: normal"><span style="color: rgb(51, 51, 51)">}</span><span style="color: rgb(51, 51, 51)">)</span>; </div>
</li>
</ol>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sutternow.com/blog/2008/11/adding-a-hint-to-indicate-links-are-external/feed</wfw:commentRss>
		</item>
		<item>
		<title>Struts2 needs better Sitemesh Support</title>
		<link>http://blog.sutternow.com/blog/2008/11/struts2-needs-better-sitemesh-support</link>
		<comments>http://blog.sutternow.com/blog/2008/11/struts2-needs-better-sitemesh-support#comments</comments>
		<pubDate>Tue, 11 Nov 2008 16:26:51 +0000</pubDate>
		<dc:creator>mpayne</dc:creator>
		
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.sutternow.com/blog/2008/11/struts2-needs-better-sitemesh-support</guid>
		<description><![CDATA[If one looks at the sitemesh 2.3 example application, an application can have both Freemarker and JSP decorators.
In addition, one has very flexible usage of sitemesh tag libs from with a decorator.
For instance one can reference freemarker&#8217;s taglib within freemarker via.
&#60;#assign page=JspTaglibs["/WEB-INF/sitemesh-page.tld"]&#62;
This allows one to include decorated external content from within a freemarker decorator.
e.g. &#60;@page.applyDecorator [...]]]></description>
			<content:encoded><![CDATA[<p>If one looks at the sitemesh 2.3 example application, an application can have both Freemarker and JSP decorators.</p>
<p>In addition, one has very flexible usage of sitemesh tag libs from with a decorator.</p>
<p>For instance one can reference freemarker&#8217;s taglib within freemarker via.<br />
&lt;#assign page=JspTaglibs["/WEB-INF/sitemesh-page.tld"]&gt;</p>
<p>This allows one to include decorated external content from within a freemarker decorator.<br />
e.g. &lt;@page.applyDecorator page=&#8221;/google.html&#8221; name=&#8221;panel&#8221; /&gt;</p>
<p>&#8212;&gt; more complete example that works in Sitemesh &#8220;Vanilla&#8221;.</p>
<p>&lt;#assign page=JspTaglibs["/WEB-INF/sitemesh-page.tld"]&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Freemarker Decorator - ${title}&lt;/title&gt;<br />
&lt;link href=&#8221;${base}/decorators/main.css&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221;&gt;<br />
${head}<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;div id=&#8221;pageTitle&#8221;&gt;${title}&lt;/div&gt;<br />
&lt;hr/&gt;</p>
<p>${body}<br />
&lt;@page.applyDecorator page=&#8221;/google.html&#8221; name=&#8221;panel&#8221; /&gt;<br />
&lt;div id=&#8221;footer&#8221;&gt;<br />
&lt;b&gt;Disclaimer:&lt;/b&gt; This site is an example site to demonstrate SiteMesh. It serves no other purpose.<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>There does not have look like there has been much movement one these issues.  Once fixed I am hoping we can</p>
<ul>
<li><a href="https://issues.apache.org/struts/browse/WW-2865">mix decorator types withing decorator.xml</a></li>
<li><a href="https://issues.apache.org/struts/browse/WW-1744">Support Sitemesh&#8217;s applyDecorator tag using Freemarker Transform</a></li>
<li><a href="https://issues.apache.org/struts/browse/WW-2246">And regain the ability to use custom jsp tablibs inside custom FM template tags</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.sutternow.com/blog/2008/11/struts2-needs-better-sitemesh-support/feed</wfw:commentRss>
		</item>
		<item>
		<title>Common maven Archetypes to keep a reference to</title>
		<link>http://blog.sutternow.com/blog/2008/09/common-maven-archetypes-to-keep-a-reference-to</link>
		<comments>http://blog.sutternow.com/blog/2008/09/common-maven-archetypes-to-keep-a-reference-to#comments</comments>
		<pubDate>Sat, 27 Sep 2008 18:20:57 +0000</pubDate>
		<dc:creator>mpayne</dc:creator>
		
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.sutternow.com/blog/2008/09/common-maven-archetypes-to-keep-a-reference-to</guid>
		<description><![CDATA[Need to keep this site handy. 

]]></description>
			<content:encoded><![CDATA[<p>Need to keep this <a href="http://docs.codehaus.org/display/MAVENUSER/Archetypes+List">site</a> handy. </p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sutternow.com/blog/2008/09/common-maven-archetypes-to-keep-a-reference-to/feed</wfw:commentRss>
		</item>
		<item>
		<title>Eclipse P2= Epic Fail</title>
		<link>http://blog.sutternow.com/blog/2008/08/eclipse-p2-epic-fail</link>
		<comments>http://blog.sutternow.com/blog/2008/08/eclipse-p2-epic-fail#comments</comments>
		<pubDate>Mon, 11 Aug 2008 13:51:16 +0000</pubDate>
		<dc:creator>mpayne</dc:creator>
		
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.sutternow.com/blog/2008/08/eclipse-p2-epic-fail</guid>
		<description><![CDATA[On both my windows work machine and Linux Desktop at home the p2 update manager was not able to cut it.  Halfway though re-installing various I used to, I used to linked in via external folder(using the .link method), P2 got into an unresolvable dependency problem that pretty much locked it from doing any further [...]]]></description>
			<content:encoded><![CDATA[<p>On both my windows work machine and Linux Desktop at home the p2 update manager was not able to cut it.  Halfway though re-installing various I used to, I used to linked in via external folder(using the .link method), P2 got into an unresolvable dependency problem that pretty much locked it from doing any further updates.  This happened twice(e.g. both machines).</p>
<p>By looking <a href="http://wiki.eclipse.org/Equinox_p2_Removal">p2 removal note, </a>I used the <a href="https://bugs.eclipse.org/bugs/attachment.cgi?id=105172">script </a>provided in this <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=224908">bug issue</a>.<br />
You pretty much put downloaded eclipse archive(s) in the &#8220;source&#8221; folder and let the script do its thing.</p>
<p>With the p2 deleted from my eclipse installations, updates seem to go smooth again.</p>
<p>Given the popularity of the bug, I am going to guess that I am not the only one who is having a problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sutternow.com/blog/2008/08/eclipse-p2-epic-fail/feed</wfw:commentRss>
		</item>
		<item>
		<title>Dealing with unmapped fields in XStream</title>
		<link>http://blog.sutternow.com/blog/2008/07/dealing-with-unmapped-fields-in-xstream</link>
		<comments>http://blog.sutternow.com/blog/2008/07/dealing-with-unmapped-fields-in-xstream#comments</comments>
		<pubDate>Wed, 30 Jul 2008 15:10:33 +0000</pubDate>
		<dc:creator>mpayne</dc:creator>
		
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.sutternow.com/blog/2008/07/dealing-with-unmapped-fields-in-xstream</guid>
		<description><![CDATA[There is a jira patch proposed here for handling XML.&#160; However that patch still needs to mature(see limitations) and gain acceptances.&#160; 
What might not be obvious(a.k.a poorly documented), is that stock XStream already has the 
capability to handling this for many use cases.
&#160; 
The test class com.thoughtworks.acceptance.CustomMapperTest
Contains a method that demonstrates such an example.
 &#160;&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>There is a jira patch proposed <a href="http://jira.codehaus.org/browse/XSTR-474">here</a> for handling XML.&nbsp; However that patch still needs to mature(see limitations) and gain acceptances.&nbsp; </p>
<p>What might not be obvious(a.k.a poorly documented), is that stock XStream already has the <br />
capability to handling this for many use cases.<br />
&nbsp; <br />
The test class com.thoughtworks.acceptance.CustomMapperTest<br />
Contains a method that demonstrates such an example.</p>
<p> &nbsp;&nbsp; public void testCanBeUsedToOmitUnexpectedElements() {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String expectedXml = “” +<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; “&lt;software&gt;\n” +<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; “&nbsp; &lt;version&gt;1.0&lt;/version&gt;\n” +<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; “&nbsp; &lt;vendor&gt;Joe&lt;/vendor&gt;\n” +<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; “&nbsp; &lt;name&gt;XStream&lt;/name&gt;\n” +<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; “&lt;/software&gt;”;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xstream = new XStream() {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; protected MapperWrapper wrapMapper(MapperWrapper next) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return new MapperWrapper(next) {</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public boolean shouldSerializeMember(Class definedIn, String fieldName) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return definedIn != Object.class ? super.shouldSerializeMember(definedIn, fieldName) : false;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xstream.alias(”software”, Software.class);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Software out = (Software) xstream.fromXML(expectedXml);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; assertEquals(”Joe”, out.vendor);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; assertEquals(”XStream”, out.name);<br />
&nbsp;&nbsp;&nbsp; }</p>
<p>In the example above the Software class consists of properties. </p>
<p>&nbsp;&nbsp;&nbsp; public String vendor;<br />
&nbsp;&nbsp;&nbsp; public String name;</p>
<p>Without the “<em>MapperWrapper</em>” the xml node “&lt;version&gt;1.0&lt;/version&gt;” would generate an exception.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sutternow.com/blog/2008/07/dealing-with-unmapped-fields-in-xstream/feed</wfw:commentRss>
		</item>
		<item>
		<title>Several years later and NetBeans still doesn&#8217;t do it for me</title>
		<link>http://blog.sutternow.com/blog/2008/05/several-years-later-and-netbeans-still-doesnt-do-it-for-me</link>
		<comments>http://blog.sutternow.com/blog/2008/05/several-years-later-and-netbeans-still-doesnt-do-it-for-me#comments</comments>
		<pubDate>Wed, 28 May 2008 02:48:40 +0000</pubDate>
		<dc:creator>mpayne</dc:creator>
		
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.sutternow.com/2008/05/27/several-years-later-and-netbeans-still-doesnt-do-it-for-me</guid>
		<description><![CDATA[I was hoping it would.&#160; I would like to use it to play around with some ruby development. I still may.&#160; However, for Java development it seems like its missing some fairly basic functionality that I have become use to in eclipse.&#160; 
One of the basic things I was trying to do is setup more [...]]]></description>
			<content:encoded><![CDATA[<p>I was hoping it would.&nbsp; I would like to use it to play around with some ruby development. I still may.&nbsp; However, for Java development it seems like its missing some fairly basic functionality that I have become use to in eclipse.&nbsp; </p>
<p>One of the basic things I was trying to do is setup more than one run profile for a project.&nbsp; In this particular project there are several main class that take command line arguments.&nbsp; In eclipse setting such profiles is fairly trivial.&nbsp; However, netbeans seems like it only wants one per project or right click on a file &#8220;Run&#8221; with no arguments.&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sutternow.com/blog/2008/05/several-years-later-and-netbeans-still-doesnt-do-it-for-me/feed</wfw:commentRss>
		</item>
		<item>
		<title>What makes jQuery a Good choice?</title>
		<link>http://blog.sutternow.com/blog/2008/05/what-makes-jquery-a-good-choice</link>
		<comments>http://blog.sutternow.com/blog/2008/05/what-makes-jquery-a-good-choice#comments</comments>
		<pubDate>Thu, 01 May 2008 20:21:26 +0000</pubDate>
		<dc:creator>mpayne</dc:creator>
		
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.sutternow.com/2008/05/01/what-makes-jquery-a-good-choice</guid>
		<description><![CDATA[Found this blog post on What Makes jQuery a Good Choice?
Thought this provided a pretty good summary. 
There is a response here. I don&#8217;t have a problem with prototype, though I have latched on to jQuery(probably aided by its better documentation).
&#160; 
My bad experiences root from Dojo, its bloat and the way its was bundled [...]]]></description>
			<content:encoded><![CDATA[<p>Found this blog post on <a href="http://blog.inquirylabs.com/2008/04/29/what-makes-jquery-a-good-choice/">What Makes jQuery a Good Choice</a>?<br />
Thought this provided a pretty good summary. </p>
<p>There is a response <a href="http://maximkulkin.blogspot.com/2008/04/on-prototype-vs-jquery.html">here</a>. I don&#8217;t have a problem with prototype, though I have latched on to jQuery(probably aided by its better documentation).<br />
&nbsp; <br />
My bad experiences root from Dojo, its bloat and the way its was bundled with Struts2</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sutternow.com/blog/2008/05/what-makes-jquery-a-good-choice/feed</wfw:commentRss>
		</item>
		<item>
		<title>Changing plugs on my 2001 Xterra</title>
		<link>http://blog.sutternow.com/blog/2008/04/changing-plugs-on-my-2001-xterra</link>
		<comments>http://blog.sutternow.com/blog/2008/04/changing-plugs-on-my-2001-xterra#comments</comments>
		<pubDate>Mon, 21 Apr 2008 15:03:55 +0000</pubDate>
		<dc:creator>mpayne</dc:creator>
		
		<category><![CDATA[cars]]></category>

		<guid isPermaLink="false">http://blog.sutternow.com/2008/04/21/changing-plugs-on-my-2001-xterra</guid>
		<description><![CDATA[@78800 miles I changes 5 of the six plugs.&#160; With daylight quickly disappearing, I decided to punt on doing the six plug till I found out some more information about it. 
I found this guide, for changing plugs.&#160; I will have to take another crack at it when the weather is nice.
There is also this [...]]]></description>
			<content:encoded><![CDATA[<p>@78800 miles I changes 5 of the six plugs.&nbsp; With daylight quickly disappearing, I decided to punt on doing the six plug till I found out some more information about it. </p>
<p>I found this <a href="http://www.nissanoffroad.net/how_to/plugs/plug.asp">guide</a>, for changing plugs.&nbsp; I will have to take another crack at it when the weather is nice.</p>
<p>There is also this guide for <a href="http://home.comcast.net/%7Exterra/tech/Diff_fluid_change.txt">changing the diff fuild</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sutternow.com/blog/2008/04/changing-plugs-on-my-2001-xterra/feed</wfw:commentRss>
		</item>
		<item>
		<title>Struts2 needs a new AliasInterceptor</title>
		<link>http://blog.sutternow.com/blog/2008/04/struts2-needs-a-new-aliasinterceptor</link>
		<comments>http://blog.sutternow.com/blog/2008/04/struts2-needs-a-new-aliasinterceptor#comments</comments>
		<pubDate>Wed, 16 Apr 2008 15:00:20 +0000</pubDate>
		<dc:creator>mpayne</dc:creator>
		
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.sutternow.com/2008/04/16/struts2-needs-a-new-aliasinterceptor</guid>
		<description><![CDATA[The original aliasInteceptor works fine for gluing together actions with different parameter names that need to be clued together.&#160; The limitation with the existing solution is that properties for both name an alias need to exist in the stack.&#160; 
The world keeps evolving though.&#160; Developers make frequent use of richer javascript widgets such as jQuery&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>The original aliasInteceptor works fine for gluing together actions with different parameter names that need to be clued together.&nbsp; The limitation with the existing solution is that properties for both name an alias need to exist in the stack.&nbsp; </p>
<p>The world keeps evolving though.&nbsp; Developers make frequent use of richer javascript widgets such as jQuery&#8217;s <a href="http://webplicity.net/flexigrid/">flexgrid</a> or <a href="http://trirand.com/jqgrid/jqgrid.html">jqGrid</a>. These widgets can consume a specific JSON response and dish out their <strong>own unique set of named parameters</strong> to the server side.&nbsp; This presents a challenge when trying to leverage existing back end code that works great, it just doesn&#8217;t match up name wise to the parameters names coming in for a specific view.</p>
<p>Assume one has a some abstract PagingQueryAction(children just set query/queryCount implementations) that can accept incoming parameters of:<br />
&nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; int pageSize = 10;&nbsp; // results per page, default 10<br />
&nbsp;&nbsp;&nbsp; int currentPage;<br />
&nbsp;&nbsp;&nbsp; String filter;<br />
&nbsp;&nbsp;&nbsp; String sortorder = &#8220;asc&#8221;;<br />
&nbsp;&nbsp;&nbsp; String sortname = &#8220;&#8221;;</p>
<p>This works fine and dandy for some existing web views, but if one wanted to make use of FlexGrid, they would create setters named.</p>
<blockquote><table cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>page</td>
<td>3</td>
</tr>
<tr>
<td>qtype</td>
<td>name</td>
</tr>
<tr>
<td>query
</td>
<td>
</td>
</tr>
<tr>
<td>rp</td>
<td>15</td>
</tr>
<tr>
<td>sortname</td>
<td>iso</td>
</tr>
<tr>
<td>sortorder</td>
<td>asc</td>
</tr>
</tbody>
</table>
</blockquote>
<p>jqGrid has yet another set of name parameters that its submits.</p>
<p>Making new implementations of things because some UI widgets is hardcoded to respond with a specfic set can be a PITA.&nbsp; </p>
<p>If there existed an AliasInterceptor that would allow one to adapt to these widget requirements people would have another solution at their disposal.</p>
<p>example of a mapping:</p>
<p>&lt;!&#8211; usaged<br />
&nbsp; <font color="#009900"><strong>&lt;param name=&#8221;aliases&#8221;&gt;#{ &#8216;incomingName&#8217; : &#8216;actionPropertyName&#8217;}&lt;/param&gt;</strong></font><br />
&#8211;&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;package name=&#8221;json&#8221; extends=&#8221;inventoryDefault&#8221; namespace=&#8221;/json&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;action name=&#8221;summaryPagedJSON&#8221; class=&#8221;stateSummary&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&lt;param name=&#8221;pageSize&#8221;&gt;15&lt;/param&gt; &lt;!&#8211; change default here &#8211;&gt;<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<font color="#009900"><strong>&lt;param name=&#8221;aliases&#8221;&gt;#{ &#8216;query&#8217; : &#8216;filter&#8217;, &#8216;rp&#8217;:'pageSize&#8217;,'page&#8217;:'currentPage&#8217; }&lt;/param&gt;</strong></p>
<p></font>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;result name=&#8221;success&#8221; type=&#8221;freemarker&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; json-pageSummary.ftl<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/result&gt;<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;result name=&#8221;input&#8221; type=&#8221;freemarker&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; json-pageSummary.ftl<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/result&gt;<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/action&gt;<br />
&nbsp;&nbsp;&nbsp; <br />
If one wanted to adapt the paging action for jqGrid, they&#8217;d simply need to <br />
supply an alias parameter of:<br />
<b><font color="#009900">&nbsp; &lt;param name=&#8221;aliases&#8221;&gt;#{ &#8217;searchString&#8217; : &#8216;filter&#8217;,'page&#8217;:'currentPage&#8217;, &#8217;sord&#8217;:&#8217;sortorder&#8217;, &#8217;sidx&#8217;:&#8217;sortname&#8217; }&lt;/param&gt;</p>
<p></font></b>(Note the freemarker template producing the JSON response may need to differ slighty as well)</p>
<p>This proposed alias interceptor looks for the alias within &#8220;invocationParameters&#8221; instead of the stack.<br />
Perhaps we need to rename things.&nbsp; The old AliasInterceptor is name ChainingAliasInterceptor<br />
and the new one is ParameterAliasInterceptor.<br />
Or perhaps the alias functionality should just be built in to the existing ParameterInterceptor.</p>
<p>snippet below<br />
&nbsp; @Override<br />
&nbsp;&nbsp;&nbsp; public String intercept(ActionInvocation invocation) throws Exception {</p>
<p>&nbsp;&nbsp;&nbsp; ActionConfig config = invocation.getProxy().getConfig();<br />
&nbsp;&nbsp;&nbsp; ActionContext ac = invocation.getInvocationContext();</p>
<p>&nbsp;&nbsp;&nbsp; // get the action&#8217;s parameters<br />
&nbsp;&nbsp;&nbsp; final Map configParameters = config.getParams();<br />
&nbsp;&nbsp;&nbsp; final Map invocationParameters = ac.getParameters();</p>
<p>&nbsp;&nbsp;&nbsp; if (configParameters.containsKey(aliasesKey)) {</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String aliasExpression = (String) configParameters.get(aliasesKey);<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; OgnlValueStack stack = (OgnlValueStack) ac.getValueStack();<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Object obj = stack.findValue(aliasExpression);</p>
<p>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (obj != null &amp;&amp; obj instanceof Map) {<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // override<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Map aliases = (Map) obj;<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Iterator itr = aliases.entrySet().iterator();<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; while (itr.hasNext()) {<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Map.Entry entry = (Map.Entry) itr.next();<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String alias = entry.getKey().toString();<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; String setterName = (String) entry.getValue();<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Object value = invocationParameters.get(alias);<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (null != value) {<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; stack.setValue(setterName, value);<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; log.debug(&#8221;invalid alias expression:&#8221; + aliasesKey);<br />
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp; return invocation.invoke();<br />
&nbsp;&nbsp;&nbsp; }</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sutternow.com/blog/2008/04/struts2-needs-a-new-aliasinterceptor/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
