<?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>maxheapsize.com &#187; refactor</title>
	<atom:link href="http://maxheapsize.com/tag/refactor/feed/" rel="self" type="application/rss+xml" />
	<link>http://maxheapsize.com</link>
	<description>Oliver Wehrens on Programming and Agile</description>
	<lastBuildDate>Tue, 14 Jun 2011 20:41:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>How to refactor Spring Webflow variables in your JSF pages with IntelliJ IDEA</title>
		<link>http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/</link>
		<comments>http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 19:40:29 +0000</pubDate>
		<dc:creator>Oliver Wehrens</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[intellij idea]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[refactor]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[webflow]]></category>

		<guid isPermaLink="false">http://maxheapsize.com/?p=128</guid>
		<description><![CDATA[We are using JSF, Facelets and Spring Webflow in the product I&#8217;m currently working on. What bugged me for some time already was that when we started to refactor the domain and the corresponding dto&#8217;s the GUI was a problem since the variables which get pulled out of the webflow are just string declarations. I [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F03%2F18%2Fhow-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmaxheapsize.com%2F2009%2F03%2F18%2Fhow-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea%2F&amp;source=owehrens&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>We are using <strong>JSF,</strong> <strong>Facelets</strong> and <strong>Spring Webflow</strong> in the product I&#8217;m currently working on. What bugged me for some time already was that when we started to refactor the domain and the corresponding dto&#8217;s the GUI was a problem since the variables which get pulled out of the webflow are just string declarations. I had to go to each xhtml file and change the code to reflect the access to the new properties.</p>
<p>For some reason I missed a feature of IntelliJ IDEA completely.  </p>
<p>If you are using Spring Webflow your code might look like this:</p>
<pre class="brush: xml; title: ;">
&lt;tr:outputText value=&quot;#{flowScope.myViewBean.creditCardDto.fullName}&quot;/&gt;
</pre>
<p>You get no code completion nor refactoring security. </p>
<p>Now it is possible to make this a little bit <strong>better</strong>.</p>
<pre class="brush: xml; title: ;">
&lt;c:set value=&quot;#{flowScope.creditCardDto}&quot; var=&quot;creditCardDto&quot;&gt;&lt;/c:set&gt;
&lt;!--@elvariable id=&quot;creditCardDto&quot;
     type=&quot;net.wehrens.accounting.CreditCardDto&quot;--&gt;
&lt;tr:outputText value=&quot;#{creditCardDto.fullName}&quot;/&gt;
</pre>
<p>With the clever Inspection &#8216;<strong>Declare External Variable in Comment Annotation</strong>&#8216; (just press Alt+Enter on the usage of creditCardDto) IDEA creates a comment annotation which tells the IDE of what type the given variable is.  Since you are using webflow, you would pull the needed variable with a c:set tag out of the flowScope (or any other scope) and then declare the variable and it&#8217;s type. </p>
<p>There you go. </p>
<p>You can now start refactoring the creditCardDto and the GUI will reflect the changes. No more manual editing.</p>
<p>To make sure the comments do not get rendered out to the client (and with that the class information) you can turn that off for faclets in the web.xml  configuration.</p>
<pre class="brush: xml; title: ;">
&lt;context-param&gt;
    &lt;param-name&gt;facelets.SKIP_COMMENTS&lt;/param-name&gt;
    &lt;param-value&gt;true&lt;/param-value&gt;
&lt;/context-param&gt;
</pre>
<p>This is not specific to JSF, facelets or anything. This works with Freemaker, JSP&#8217;s and others as well.</p>
<p>My life just got a whole lot better.</p>
<div class="google_plusone_widget"><g:plusone 
      count="true" href="http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/" size="medium"></g:plusone></div><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/&amp;title=How+to+refactor+Spring+Webflow+variables+in+your+JSF+pages+with+IntelliJ+IDEA" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/&amp;title=How+to+refactor+Spring+Webflow+variables+in+your+JSF+pages+with+IntelliJ+IDEA" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=How+to+refactor+Spring+Webflow+variables+in+your+JSF+pages+with+IntelliJ+IDEA&amp;url=http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/&amp;title=How+to+refactor+Spring+Webflow+variables+in+your+JSF+pages+with+IntelliJ+IDEA" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/&amp;title=How+to+refactor+Spring+Webflow+variables+in+your+JSF+pages+with+IntelliJ+IDEA" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/&amp;bm_description=How+to+refactor+Spring+Webflow+variables+in+your+JSF+pages+with+IntelliJ+IDEA" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/&amp;title=How+to+refactor+Spring+Webflow+variables+in+your+JSF+pages+with+IntelliJ+IDEA" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/&amp;title=How+to+refactor+Spring+Webflow+variables+in+your+JSF+pages+with+IntelliJ+IDEA" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.sphere.com/sphereit/http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/" rel="nofollow" title="Add to&nbsp;SphereIt"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/sphereit.png" title="Add to&nbsp;SphereIt" alt="Add to&nbsp;SphereIt" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.spurl.net/spurl.php?url=http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/&amp;title=How+to+refactor+Spring+Webflow+variables+in+your+JSF+pages+with+IntelliJ+IDEA" rel="nofollow" title="Add to&nbsp;Spurl"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/spurl.png" title="Add to&nbsp;Spurl" alt="Add to&nbsp;Spurl" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+How+to+refactor+Spring+Webflow+variables+in+your+JSF+pages+with+IntelliJ+IDEA+@+http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://maxheapsize.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://maxheapsize.com/2009/03/18/how-to-refactor-spring-webflow-variables-in-your-jsf-pages-with-intellij-idea/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

