<?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>Washington Botelho</title>
	<atom:link href="http://www.wbotelhos.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wbotelhos.com</link>
	<description>If you have no gift, have some willing.</description>
	<lastBuildDate>Thu, 19 Jan 2012 18:21:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>jQuery Taby &#8211; A Textarea Tabulator</title>
		<link>http://www.wbotelhos.com/2012/01/19/jquery-taby-a-textarea-tabulator/</link>
		<comments>http://www.wbotelhos.com/2012/01/19/jquery-taby-a-textarea-tabulator/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 17:47:16 +0000</pubDate>
		<dc:creator>wbotelhos</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.wbotelhos.com/?p=1182</guid>
		<description><![CDATA[jQuery Taby is a plugin to enable tabulation in textarea fields.


<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2012%2F01%2F19%2Fjquery-taby-a-textarea-tabulator%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2012%2F01%2F19%2Fjquery-taby-a-textarea-tabulator%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></description>
			<content:encoded><![CDATA[<p><a href="http://wbotelhos.com/taby" target="_blank" style="14px verdana;">jQuery Taby</a> is a plugin to enable tabulation in textarea fields. <b>(<a href="http://www.wbotelhos.com/taby" target="_blank">Demo</a>)</b></p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Required files:
</div>
<p>+ jquery.taby.min.js</p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Default configuration:
</div>
<pre class="brush: jscript;">
$('#area').taby();
</pre>
<pre class="brush: xml;">
&lt;textarea id=&quot;area&quot;&gt;&lt;/textarea&gt;
</pre>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 10px; margin-top: 20px;">
    Demo:
</div>
<p><a href="http://www.wbotelhos.com/taby" target="_blank">http://wbotelhos.com/taby</a></p>
<div style="color: #F00; font: bold 16px arial; margin-bottom: 10px; margin-top: 20px;">
    Please:
</div>
<p>- Format your code before paste it here, I will probably have to read it;<br />
- Use code formatter to write it:</p>
<div style="font: 14px monospace; margin-bottom: 20px;">
    <b><span>[</span>source language="javascript"]</b><i>your_code_here</i><b>[/source<span>]</span></b>
</div>



<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2012%2F01%2F19%2Fjquery-taby-a-textarea-tabulator%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2012%2F01%2F19%2Fjquery-taby-a-textarea-tabulator%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></content:encoded>
			<wfw:commentRss>http://www.wbotelhos.com/2012/01/19/jquery-taby-a-textarea-tabulator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Chrony &#8211; A Count Down Plugin</title>
		<link>http://www.wbotelhos.com/2011/11/06/jquery-chrony-a-count-down-plugin/</link>
		<comments>http://www.wbotelhos.com/2011/11/06/jquery-chrony-a-count-down-plugin/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 01:38:54 +0000</pubDate>
		<dc:creator>wbotelhos</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.wbotelhos.com/?p=1124</guid>
		<description><![CDATA[jQuery Chrony is a plugin that creates a chronometer.


<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F11%2F06%2Fjquery-chrony-a-count-down-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F11%2F06%2Fjquery-chrony-a-count-down-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></description>
			<content:encoded><![CDATA[<p><a href="http://wbotelhos.com/chrony" target="_blank" style="14px verdana;">jQuery Chrony</a> is a plugin that creates a chronometer. <b>(<a href="http://www.wbotelhos.com/chrony" target="_blank">Demo</a>)</b></p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Required files:
</div>
<p>+ jquery.chrony.min.js</p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Default configuration:
</div>
<pre class="brush: jscript;">
$('#time').chrony({ hour: 1, minute: 2, second: 3 });
</pre>
<pre class="brush: xml;">
&lt;div id=&quot;time&quot;&gt;&lt;/div&gt;
</pre>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 10px; margin-top: 20px;">
    Demo:
</div>
<p><a href="http://www.wbotelhos.com/chrony" target="_blank">http://wbotelhos.com/chrony</a></p>
<div style="color: #F00; font: bold 16px arial; margin-bottom: 10px; margin-top: 20px;">
    Please:
</div>
<p>- Format your code before paste it here, I will probably have to read it;<br />
- Use code formatter to write it:</p>
<div style="font: 14px monospace; margin-bottom: 20px;">
    <b><span>[</span>source language="javascript"]</b><i>your_code_here</i><b>[/source<span>]</span></b>
</div>



<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F11%2F06%2Fjquery-chrony-a-count-down-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F11%2F06%2Fjquery-chrony-a-count-down-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></content:encoded>
			<wfw:commentRss>http://www.wbotelhos.com/2011/11/06/jquery-chrony-a-count-down-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Styly &#8211; A Stylish Plugin</title>
		<link>http://www.wbotelhos.com/2011/10/15/jquery-styly-a-stylish-plugin/</link>
		<comments>http://www.wbotelhos.com/2011/10/15/jquery-styly-a-stylish-plugin/#comments</comments>
		<pubDate>Sat, 15 Oct 2011 23:31:57 +0000</pubDate>
		<dc:creator>wbotelhos</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.wbotelhos.com/?p=1116</guid>
		<description><![CDATA[jQuery Styly is a plugin to style your checkbox and radio elements.


<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F10%2F15%2Fjquery-styly-a-stylish-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F10%2F15%2Fjquery-styly-a-stylish-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></description>
			<content:encoded><![CDATA[<p><a href="http://wbotelhos.com/styly" target="_blank" style="14px verdana;">jQuery Styly</a> is a plugin to style your checkbox and radio elements. <b>(<a href="http://www.wbotelhos.com/styly" target="_blank">Demo</a>)</b></p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Required files:
</div>
<p>+ jquery.styly.min.js<br />
+ jquery.styly.css<br />
+ check.png<br />
+ radio.png</p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Default configuration:
</div>
<pre class="brush: jscript;">
$('.style').styly();
</pre>
<pre class="brush: xml;">
&lt;label for=&quot;like&quot;&gt;Like?&lt;/label&gt;
&lt;input id=&quot;like&quot; type=&quot;checkbox&quot; class=&quot;style&quot; /&gt;

&lt;label for=&quot;dislike&quot;&gt;Dislike?&lt;/label&gt;
&lt;input id=&quot;dislike&quot; type=&quot;checkbox&quot; class=&quot;style&quot; /&gt;
</pre>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 10px; margin-top: 20px;">
    Demo:
</div>
<p><a href="http://www.wbotelhos.com/styly" target="_blank">http://wbotelhos.com/styly</a></p>
<div style="color: #F00; font: bold 16px arial; margin-bottom: 10px; margin-top: 20px;">
    Please:
</div>
<p>- Format your code before paste it here, I will probably have to read it;<br />
- Use code formatter to write it:</p>
<div style="font: 14px monospace; margin-bottom: 20px;">
    <b><span>[</span>source language="javascript"]</b><i>your_code_here</i><b>[/source<span>]</span></b>
</div>



<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F10%2F15%2Fjquery-styly-a-stylish-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F10%2F15%2Fjquery-styly-a-stylish-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></content:encoded>
			<wfw:commentRss>http://www.wbotelhos.com/2011/10/15/jquery-styly-a-stylish-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Gridy &#8211; A Grid Plugin</title>
		<link>http://www.wbotelhos.com/2011/06/26/jquery-gridy-a-grid-plugin/</link>
		<comments>http://www.wbotelhos.com/2011/06/26/jquery-gridy-a-grid-plugin/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 22:11:12 +0000</pubDate>
		<dc:creator>wbotelhos</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.wbotelhos.com/?p=1102</guid>
		<description><![CDATA[jQuery Gridy is a plugin that generates a highly customizable grid using templates.


<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F06%2F26%2Fjquery-gridy-a-grid-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F06%2F26%2Fjquery-gridy-a-grid-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></description>
			<content:encoded><![CDATA[<p><a href="http://wbotelhos.com/gridy" target="_blank" style="14px verdana;">jQuery Gridy</a> is a plugin that generates a highly customizable grid using templates. <b>(<a href="http://www.wbotelhos.com/gridy" target="_blank">Demo</a>)</b></p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Required files:
</div>
<p>+ jquery.gridy.min.js<br />
+ jquery-icons.png<br />
+ loading.png</p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Default configuration:
</div>
<pre class="brush: jscript;">
$('#grid').gridy({ url: '/gridy' });
</pre>
<pre class="brush: jscript;">
{&quot;entityList&quot;: [{&quot;id&quot;: 1, &quot;name&quot;: &quot;Washington Botelho&quot;, &quot;email&quot;: &quot;gridy@wbotelhos.com&quot;}], &quot;total&quot;: 1}
</pre>
<pre class="brush: xml;">
&lt;table id=&quot;grid&quot;&gt;&lt;/table&gt;
</pre>
<pre class="brush: jscript;">
&lt;script id=&quot;template&quot; type=&quot;text/x-jquery-tmpl&quot;&gt;
   &lt;tr&gt;
      &lt;td&gt;${name}&lt;/td&gt;
      &lt;td&gt;${email}&lt;/td&gt;
   &lt;/tr&gt;
&lt;/script&gt;
</pre>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 10px; margin-top: 20px;">
    Demo:
</div>
<p><a href="http://www.wbotelhos.com/gridy" target="_blank">http://wbotelhos.com/gridy</a></p>
<div style="color: #F00; font: bold 16px arial; margin-bottom: 10px; margin-top: 20px;">
    Please:
</div>
<p>- Format your code before paste it here, I will probably have to read it;<br />
- Use code formatter to write it:</p>
<div style="font: 14px monospace; margin-bottom: 20px;">
    <b><span>[</span>source language="javascript"]</b><i>your_code_here</i><b>[/source<span>]</span></b>
</div>



<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F06%2F26%2Fjquery-gridy-a-grid-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F06%2F26%2Fjquery-gridy-a-grid-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></content:encoded>
			<wfw:commentRss>http://www.wbotelhos.com/2011/06/26/jquery-gridy-a-grid-plugin/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>jQuery Slidy &#8211; A Transition Plugin</title>
		<link>http://www.wbotelhos.com/2011/03/14/jquery-slidy-a-transition-plugin/</link>
		<comments>http://www.wbotelhos.com/2011/03/14/jquery-slidy-a-transition-plugin/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 02:36:45 +0000</pubDate>
		<dc:creator>wbotelhos</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.wbotelhos.com/?p=1097</guid>
		<description><![CDATA[jQuery Slidy is a plugin that generates a slide transition.


<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F03%2F14%2Fjquery-slidy-a-transition-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F03%2F14%2Fjquery-slidy-a-transition-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></description>
			<content:encoded><![CDATA[<p><a href="http://wbotelhos.com/slidy" target="_blank" style="14px verdana;">jQuery Slidy</a> is a plugin that generates a slide transition. <b>(<a href="http://www.wbotelhos.com/slidy" target="_blank">Demo</a>)</b></p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Required files:
</div>
<p>+ jquery.slidy.min.js<br />
+ jquery.slidy.css</p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Default configuration:
</div>
<pre class="brush: jscript;">
$('#banner').slidy();
</pre>
<pre class="brush: xml;">
&lt;div id=&quot;banner&quot;&gt;
    &lt;img src=&quot;image-1.jpg&quot; /&gt;
    &lt;img src=&quot;image-2.jpg&quot; /&gt;
    &lt;img src=&quot;image-3.jpg&quot; /&gt;
&lt;/div&gt;
</pre>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 10px; margin-top: 20px;">
    Demo:
</div>
<p><a href="http://www.wbotelhos.com/slidy" target="_blank">http://wbotelhos.com/slidy</a></p>
<div style="color: #F00; font: bold 16px arial; margin-bottom: 10px; margin-top: 20px;">
    Please:
</div>
<p>- Format your code before paste it here, I will probably have to read it;<br />
- Use code formatter to write it:</p>
<div style="font: 14px monospace; margin-bottom: 20px;">
    <b><span>[</span>source language="javascript"]</b><i>your_code_here</i><b>[/source<span>]</span></b>
</div>



<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F03%2F14%2Fjquery-slidy-a-transition-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F03%2F14%2Fjquery-slidy-a-transition-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></content:encoded>
			<wfw:commentRss>http://www.wbotelhos.com/2011/03/14/jquery-slidy-a-transition-plugin/feed/</wfw:commentRss>
		<slash:comments>60</slash:comments>
		</item>
		<item>
		<title>jQuery Capty &#8211; A Caption Plugin</title>
		<link>http://www.wbotelhos.com/2011/03/14/jquery-capty-a-caption-plugin/</link>
		<comments>http://www.wbotelhos.com/2011/03/14/jquery-capty-a-caption-plugin/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 02:30:31 +0000</pubDate>
		<dc:creator>wbotelhos</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.wbotelhos.com/?p=1092</guid>
		<description><![CDATA[jQuery Capty is a plugin jQuery Capty is a plugin that creates captions over the images.


<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F03%2F14%2Fjquery-capty-a-caption-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F03%2F14%2Fjquery-capty-a-caption-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></description>
			<content:encoded><![CDATA[<p><a href="http://wbotelhos.com/capty" target="_blank" style="14px verdana;">jQuery Capty</a> is a plugin that creates captions over the images. <b>(<a href="http://www.wbotelhos.com/capty" target="_blank">Demo</a>)</b></p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Required files:
</div>
<p>+ jquery.capty.min.js<br />
+ jquery.capty.css</p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Default configuration:
</div>
<pre class="brush: jscript;">
$('#default').capty();
</pre>
<pre class="brush: xml;">
&lt;img id=&quot;default&quot; src=&quot;image.jpg&quot; alt=&quot;Super Mario Bros.®&quot; width=&quot;342&quot; height=&quot;262&quot;/&gt;
</pre>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 10px; margin-top: 20px;">
    Demo:
</div>
<p><a href="http://www.wbotelhos.com/capty" target="_blank">http://wbotelhos.com/capty</a></p>
<div style="color: #F00; font: bold 16px arial; margin-bottom: 10px; margin-top: 20px;">
    Please:
</div>
<p>- Format your code before paste it here, I will probably have to read it;<br />
- Use code formatter to write it:</p>
<div style="font: 14px monospace; margin-bottom: 20px;">
    <b><span>[</span>source language="javascript"]</b><i>your_code_here</i><b>[/source<span>]</span></b>
</div>



<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F03%2F14%2Fjquery-capty-a-caption-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F03%2F14%2Fjquery-capty-a-caption-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></content:encoded>
			<wfw:commentRss>http://www.wbotelhos.com/2011/03/14/jquery-capty-a-caption-plugin/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>jQuery Stepy &#8211; A Wizard Plugin</title>
		<link>http://www.wbotelhos.com/2011/03/14/jquery-stepy-a-wizard-plugin/</link>
		<comments>http://www.wbotelhos.com/2011/03/14/jquery-stepy-a-wizard-plugin/#comments</comments>
		<pubDate>Tue, 15 Mar 2011 02:26:29 +0000</pubDate>
		<dc:creator>wbotelhos</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.wbotelhos.com/?p=1090</guid>
		<description><![CDATA[jQuery Stepy is a plugin based on FormToWizard that generates a customizable wizard.


<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F03%2F14%2Fjquery-stepy-a-wizard-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F03%2F14%2Fjquery-stepy-a-wizard-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></description>
			<content:encoded><![CDATA[<p><a href="http://wbotelhos.com/stepy" target="_blank" style="14px verdana;">jQuery Stepy</a> is a plugin based on FormToWizard that generates a customizable wizard. <b>(<a href="http://www.wbotelhos.com/stepy" target="_blank">Demo</a>)</b></p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Required files:
</div>
<p>+ jquery.stepy.min.js<br />
+ jquery.stepy.css</p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Default configuration:
</div>
<pre class="brush: jscript;">
$('#step').stepy();
</pre>
<pre class="brush: xml;">
&lt;form id=&quot;step&quot;&gt;
  &lt;fieldset title=&quot;Title&quot;&gt;
    &lt;legend&gt;description&lt;/legend&gt;
    &lt;!-- input fields --&gt;
  &lt;/fieldset&gt;

  &lt;fieldset title=&quot;Title&quot;&gt;
    &lt;legend&gt;description&lt;/legend&gt;
    &lt;!-- input fields --&gt;
  &lt;/fieldset&gt;

  &lt;input type=&quot;submit&quot; class=&quot;finish&quot;/&gt;
&lt;/form&gt;
</pre>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 10px; margin-top: 20px;">
    Demo:
</div>
<p><a href="http://www.wbotelhos.com/stepy" target="_blank">http://wbotelhos.com/stepy</a></p>
<div style="color: #F00; font: bold 16px arial; margin-bottom: 10px; margin-top: 20px;">
    Please:
</div>
<p>- Format your code before paste it here, I will probably have to read it;<br />
- Use code formatter to write it:</p>
<div style="font: 14px monospace; margin-bottom: 20px;">
    <b><span>[</span>source language="javascript"]</b><i>your_code_here</i><b>[/source<span>]</span></b>
</div>



<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F03%2F14%2Fjquery-stepy-a-wizard-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2011%2F03%2F14%2Fjquery-stepy-a-wizard-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></content:encoded>
			<wfw:commentRss>http://www.wbotelhos.com/2011/03/14/jquery-stepy-a-wizard-plugin/feed/</wfw:commentRss>
		<slash:comments>80</slash:comments>
		</item>
		<item>
		<title>JPA and VRaptor 3</title>
		<link>http://www.wbotelhos.com/2010/12/18/jpa-and-vraptor-3/</link>
		<comments>http://www.wbotelhos.com/2010/12/18/jpa-and-vraptor-3/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 03:32:30 +0000</pubDate>
		<dc:creator>wbotelhos</dc:creator>
				<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JPA]]></category>
		<category><![CDATA[VRaptor]]></category>

		<guid isPermaLink="false">http://www.wbotelhos.com/?p=1058</guid>
		<description><![CDATA[We know that nowadays is essential to have a persistence framework to avoid us the the hard work of to create tables, key exchange and the like. If you want productivity and an incredible features, I can say Hibernate is a great choice.


<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2010%2F12%2F18%2Fjpa-and-vraptor-3%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2010%2F12%2F18%2Fjpa-and-vraptor-3%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></description>
			<content:encoded><![CDATA[<p><strong>Updated at January 5th 2011.</strong></p>
<p>We know that nowadays is essential to have a persistence framework to avoid the hard work of to create tables, key exchange and so one. If you want productivity and incredibles features, I can say that <a href="https://www.hibernate.org/" target="blank">Hibernate</a> is a great choice.</p>
<p><strong>Objective:</strong></p>
<p>Create a project in which we configure and use the API <a href="http://pt.wikipedia.org/wiki/Java_Persistence_API" target="blank">JPA</a> with automated transaction control with the <a href="http://vraptor.caelum.com.br/" target="blank">VRaptor 3</a>.</p>
<p>We&#8217;ll start by creating a configuration file for our database.</p>
<p><strong>Creating the configuration file (persistence.xml):</strong></p>
<pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;

&lt;persistence&gt;
   &lt;persistence-unit name=&quot;default&quot;&gt;
      &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;

      &lt;properties&gt;
        &lt;property name=&quot;hibernate.connection.driver_class&quot; value=&quot;com.mysql.jdbc.Driver&quot;/&gt;
        &lt;property name=&quot;hibernate.connection.username&quot; value=&quot;root&quot;/&gt;
        &lt;property name=&quot;hibernate.connection.password&quot; value=&quot;root&quot;/&gt;
        &lt;property name=&quot;hibernate.connection.url&quot; value=&quot;jdbc:mysql://127.0.0.1:3306/banco&quot;/&gt;
        &lt;property name=&quot;hibernate.dialect&quot; value=&quot;org.hibernate.dialect.MySQLInnoDBDialect&quot;/&gt;

        &lt;property name=&quot;hibernate.hbm2ddl.auto&quot; value=&quot;update&quot;/&gt;

      &lt;/properties&gt;
   &lt;/persistence-unit&gt;
&lt;/persistence&gt;
</pre>
<p><strong>Line 04</strong>: have a persistence unit called <strong>default</strong>;<br />
<strong>Line 05</strong>: we use the Hibernate provider;<br />
<strong>Line 08</strong>: we use the MySQL database and its driver;<br />
<strong>Line 09-10</strong>: the database use the username and password as &#8220;<strong>root</strong>&#8220;;<br />
<strong>Line 11</strong>: connection localhost with default port 3306 in the schema &#8220;<strong>banco</strong>&#8220;;<br />
<strong>Line 12</strong>: the dialect used is the MySQL&#8217;s InnoDB;<br />
<strong>Line 14</strong>: we using the <a href="https://www.hibernate.org/256.html" target="blank">HBM</a> to generate the tables automatically according to the entities annotated with  <code>@Entity</code>. The value <strong>update</strong> add or update the columns in the database when you modifies the entity, but it&#8217;s not remove the columns.</p>
<blockquote><p>Importantly, you must use InnoDB because it is transactional unlike the MyISAM.</p></blockquote>
<p>Our setup is ready, but we need a class that use these settings and do our application to connect to the database.</p>
<p>In principle we would create a <code>EntityManagerUtil</code> like this:</p>
<pre class="brush: java;">
public class EntityManagerUtil {

    private static EntityManagerFactory emf;

    public static EntityManager getEntityManager() {
        if (emf == null) {
            emf = Persistence.createEntityManagerFactory(&quot;default&quot;);
        }

        return emf.createEntityManager();
    }

    public static void close() {
        emf.close();
    }

}
</pre>
<p>And get the DAOs in our connection as following:</p>
<pre class="brush: java;">
@Component
public class UserDao {

    private EntityManager manager = EntityManagerUtil.getEntityManager();
    ...

}
</pre>
<p>Through our utility class would be possible to receive the <code>EntityManager</code> and the <code> Transaction</code> either, but we&#8217;ll have something undesirable, the <strong>coupling</strong>.</p>
<p>Our DAO is worrying about how to get it and this code is tied to the class itself. The ideal would be to receive this object through a <code>set</code> method, constructor or <a href="http://pt.wikipedia.org/wiki/Inje%C3%A7%C3%A3o_de_depend%C3%AAncia" target="blank">dependency injection</a> and int this point VRaptor comes to help us. (:</p>
<p>In the place of the class <code>EntityManagerUtil</code> we&#8217;ll register a <a href="http://vraptor.caelum.com.br/documentacao/componentes-utilitarios-opcionais/" target="blank">optional component</a>.</p>
<p><strong>Creating the CustomProvider component:</strong></p>
<pre class="brush: java;">
public class CustomProvider extends SpringProvider {

    @Override
    protected void registerCustomComponents(ComponentRegistry registry) {
        registry.register(EntityManagerCreator.class, EntityManagerCreator.class);
        registry.register(EntityManagerFactoryCreator.class, EntityManagerFactoryCreator.class);
        registry.register(JPATransactionInterceptor.class, JPATransactionInterceptor.class);
    }

}
</pre>
<p>Our class extends <code>SpringProvider</code> and override the method <code>registerCustomComponents</code> to register the <code>EntityManagerCreator</code>, <code>FactoryCreator</code> and <code>JPATransaction</code> providing us the <code>EntityManager</code> in a transparent way.</p>
<p>After created this class, we&#8217;ll register it as a provider in <strong>web.xml</strong>:</p>
<pre class="brush: xml;">
&lt;context-param&gt;
   &lt;param-name&gt;com.caelum.vraptor.provider&lt;/param-name&gt;
   &lt;param-value&gt;com.wbotelhos.provider.CustomProvider&lt;/param-value&gt;
&lt;/context-param&gt;
</pre>
<p>Using our provider we can decide if we&#8217;ll register the transaction control component or not. But the VRaptor still makes more for us, and as expected we would want all these components, VRaptor already included in his <code>util</code> other package called <code>jpa</code> which already register these three components that replaces the <code>CustomProvider</code> just changing the configuration of the <code>web.xml</code> to point it:</p>
<pre class="brush: xml;">
&lt;context-param&gt;
    &lt;param-name&gt;br.com.caelum.vraptor.packages&lt;/param-name&gt;
    &lt;param-value&gt;br.com.caelum.vraptor.util.jpa&lt;/param-value&gt;
&lt;/context-param&gt;
</pre>
<p>Now you can remove all <code>begin</code> and <code>commit</code> of the code because VRaptor will worry about it for you. As for <code>rollback</code> you need to keep it, because when an error is throwed on any operation, all of other will be reverted, since VRaptor keep this actions set in a single transaction.</p>
<p>Ok! Now VRaptor already know should seek and use our <code>persistence.xml</code>, which must be located in <a href="http://www.guj.com.br/article.show.logic?id=108" target="blank">classpath</a> within <strong>src/META-INF</strong>.</p>
<blockquote><p>VRaptor by default searchs for a persistence-unit called &#8220;<strong>default</strong>&#8220;. Make sure you have created it with this name: <code>&lt;persistence-unit name="default"</code> &#8230;</p></blockquote>
<p>Then the DAO receives by injection the <code>EntityManager</code> avoiding the high coupling:</p>
<pre class="brush: sql;">
@Component
public class UsuarioDao {

    private EntityManager manager;

    UsuarioDao (EntityManager manager) {
        this.manager = manager;
    }

    ...

}
</pre>
<blockquote><p>Try to use a generic DAO, avoiding duplication of code.</p></blockquote>
<p><strong>Creating the database schema and populating it:</strong></p>
<p>There is a file, <code>banco.sql</code>, within the project that have the SQL code to create and populate the database, but if you prefer, just run the application and Hibernate will create the entire database due to <em>SchemaExport (hbm2ddl)</em>, leaving for you only the task of populating it.</p>
<p>Let&#8217;s create the entity <code>Usuario</code>:</p>
<pre class="brush: java;">
@Entity
public class Usuario {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String nome;
    private String email;

    // getters and setters

}
</pre>
<p>We said that <code>Usuario</code> is a entity and the <code>id</code> is a key incremented by the database.</p>
<p>Now we can create a method to put the Hibernate in action:</p>
<pre class="brush: java;">
public Usuario loadByNome(String nome) throws Exception {
    try {
        Query query = manager.createQuery(&quot;from Usuario where nome = :nome&quot;);
        query.setParameter(&quot;nome&quot;, nome);
        Usuario usuario = (Usuario) query.getSingleResult();
        return usuario;
    } catch (NoResultException e) {
        manager.getTransaction().rollback();
        throw new Exception(&quot;Nenhum resultado!&quot;);
    } catch (Exception e) {
        manager.getTransaction().rollback();
        throw new Exception(&quot;Ocorreu um erro na busca!&quot;);
    }
}
</pre>
<p>In the above query we searched for the name passed as parameter and was returned an <code>Usuario</code>.</p>
<blockquote><p>Were placed a <code>rollback</code> just to illustrate its use, although it is not necessary in this case.</p></blockquote>
<p>Let&#8217;s create the controller to call this method and provide the result on screen:</p>
<pre class="brush: java;">
@Resource
public class UsuarioController {

    private Result result;
    private UsuarioDao usuarioDao;

    public UsuarioController(Result result, UsuarioDao usuarioDao) {
        this.result = result;
        this.usuarioDao = usuarioDao;
    }

    @Get
    @Path(&quot;/usuario/consultar&quot;)
    public Usuario consulta(Usuario entity) {
        try {
            return usuarioDao.loadByNome(entity.getNome());
        } catch (Exception e) {
            result.include(&quot;message&quot;, e.getMessage());
        }
        return null;
    }

}
</pre>
<p>We injected the resources we need and called the method that return a user with the same name of the parameter.</p>
<p>Finally we create the query and result pages.</p>
<p><strong>Query page (index/index.jsp):</strong></p>
<pre class="brush: java;">
&lt;form action=&quot;&lt;c:url value='/usuario/consultar'/&gt;&quot; method=&quot;get&quot;&gt;
    Consultar: &lt;input type=&quot;text&quot; name=&quot;entity.nome&quot;/&gt;
    &lt;input type=&quot;submit&quot;/&gt;
&lt;/form&gt;
</pre>
<p><strong>Result page (user/result.jsp):</strong></p>
<pre class="brush: java;">
${message}

&lt;c:if test=&quot;${user != null}&quot;&gt;
    ID: ${user.id}
    Nome: ${user.nome}
    E-mail: ${user.email}
&lt;/c:if&gt;
</pre>
<p>The <a href="http://vraptor.caelum.com.br/documentacao/componentes-utilitarios-opcionais/" target="blank">utility components</a> of the VRaptor also has other features such as <code>Hibernate Session</code> and <code>SessionFactory</code>, and I believe it will increasingly make our lives easier.</p>
<p>See this code running on: <a href="http://www.moviecollection.com.br" target="_blank">http://moviecollection.com.br</a></p>
<p>Thanks to <a href="http://mariopeixoto.wordpress.com/" target="blank">Mário Peixoto</a> that explained several doubts.</p>
<p><strong>Project link</strong>:</p>
<p><a href="http://github.com/wbotelhos/jpa-vraptor-3" target="_blank">http://github.com/wbotelhos/jpa-vraptor-3</a></p>



<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2010%2F12%2F18%2Fjpa-and-vraptor-3%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2010%2F12%2F18%2Fjpa-and-vraptor-3%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></content:encoded>
			<wfw:commentRss>http://www.wbotelhos.com/2010/12/18/jpa-and-vraptor-3/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Getting Started with VRaptor 3</title>
		<link>http://www.wbotelhos.com/2010/11/24/getting-started-with-vraptor-3/</link>
		<comments>http://www.wbotelhos.com/2010/11/24/getting-started-with-vraptor-3/#comments</comments>
		<pubDate>Wed, 24 Nov 2010 17:51:45 +0000</pubDate>
		<dc:creator>wbotelhos</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[VRaptor]]></category>

		<guid isPermaLink="false">http://www.wbotelhos.com/?p=1043</guid>
		<description><![CDATA[For those follow closely the Java area is not new that VRaptor is exploding with success and good references. Then I'll show you a complete CRUD using this framework and his power.


<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2010%2F11%2F24%2Fgetting-started-with-vraptor-3%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2010%2F11%2F24%2Fgetting-started-with-vraptor-3%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></description>
			<content:encoded><![CDATA[<p>For those follow closely the Java area is not new the <a href="http://vraptor.caelum.com.br/" target="_blank">VRaptor</a> is growing up with good references. I work with some projects at <a href="http://giran.com.br" target="_blank">Giran</a> using it, and I&#8217;m so satisfied.</p>
<p><strong>Knowing the framework</strong></p>
<p>VRaptor is a <a href="http://pt.wikipedia.org/wiki/MVC" target="_blank">MVC</a> framework that works with its methods of your controller in a exposed way and <strong><a href="http://pt.wikipedia.org/wiki/RESTful" target="_blank">RESTFul</a></strong>, then we can access a public method, for example, by URI: <code>/usuario/cadastrar</code> in an easy and intuitive way. Following is a brief list of some features:</p>
<p>- <a href="http://pt.wikipedia.org/wiki/Inje%C3%A7%C3%A3o_de_depend%C3%AAncia" target="_blank">Dependency Injection</a>;<br />
- Automatic Cast;<br />
- Converters;<br />
- Interceptors;<br />
- Integration with Spring, Hibernate and JPA;<br />
- Unit Testing Facility;<br />
- Validations;<br />
- Redirects;<br />
- Parametrized URI;<br />
- And other more&#8230;</p>
<p>And the best of all, it&#8217;s open source, Brazilian and has a <a href="http://groups.google.com/group/caelum-vraptor" target="_blank">discussion list</a> with people willing to help, beyond keep track the framework development.</p>
<p><strong>Goal</strong></p>
<p>Create a <a href="http://pt.wikipedia.org/wiki/CRUD" target="_blank">CRUD</a> using the <a href="http://vraptor.caelum.com.br/download.jsp" target="_blank">latest version</a> of the VRaptor 3 simulating the persistence in the database.</p>
<p><strong>Configuring the project</strong>:</p>
<p>After you download the (blank project) and decompress the file vraptor-blank-project-3.x.x.zip in your workspace, simply import the project in the <a href="http://www.eclipse.org" target="_blank">Eclipse</a>, add to your server and it will be ready to run.</p>
<blockquote><p>The project comes with some files to run on <a href="http://netbeans.org/" target="_blank">NetBeans</a> either, if you don&#8217;t use it, you need to keep only the folders <code>Webcontent</code> and <code>src</code>, and you can remove the other files.</p></blockquote>
<p><strong>Creating the controller</strong></p>
<p>We&#8217;ll create a package <code>br.com.wbotelhos.controller</code> and in this package the <code>IndexController</code>. (the blank project already contains this as example)</p>
<pre class="brush: java;">
@Resource
public class IndexController {

    @Path(&quot;/&quot;)
    public void index() {
    }

}
</pre>
<p>All controllers should be named in the format &#8220;FolderName<strong>Controller</strong>&#8221; and must be annotated with <code>@Resource</code> to expose the resources and make the public methods accessible by URI. In the above example the path &#8220;<code>/</code>&#8221; will execute the method <code>index</code>, in which will redirect to a page with the same name of this method, contained within a folder with the same name of the controller like this: <code>WEB-INF/jsp/<strong>index</strong>/<strong>index</strong>.jsp.</code> All pages should be located in <code>WEB-INF/jsp/folder</code> where folder&#8217;s name is equals the name of the entity.</p>
<p><strong>@Path</strong></p>
<p>VRaptor is a action based framework and its methods are accessed by URI. The Path annotation indicates the URI to be accessed so that we can execute a method. By convention we use it like this:</p>
<p><code>@Path("entityName/methodName")</code>:</p>
<pre class="brush: java;">
@Path(&quot;/user/listAll&quot;)
public void list() { }
</pre>
<p>If we had not noted the list method with <code>@Path</code> by default would be <code>/user/list</code>, but we can annotate and the Path don&#8217;t must to be the same of the method name.</p>
<p><strong>Methods</strong></p>
<p>The method access is execute through the most commons HTTP operations as <code>GET</code>, <code>POST</code>, <code>PUT</code> and <code>DELETE</code> which are usually combined with a CRUD.</p>
<p>We can make a kind of rule like:</p>
<p><strong>GET</strong> &#8211; List data and access links;<br />
<strong>POST</strong> &#8211; Save an entity;<br />
<strong>PUT</strong> &#8211; Update an entity; and<br />
<strong>DELETE</strong> &#8211; Delete an entity.</p>
<p>Even if a method has the same path it can differentiate by the execution type:</p>
<pre class="brush: java;">
@Post
@Path(&quot;/user&quot;)
public void save() {
}

@Put
@Path(&quot;/user&quot;)
public void edit() {
}
</pre>
<p>By default method access consists of <code>controllerName/methodName/</code> using <code>@Get</code>, and is not necessary in this case noted it, however I recommend always explicit the annotations, avoiding confuse the access method as well the path.</p>
<p><strong>Creating the home page</strong></p>
<p>Now we&#8217;ll create a page called <code>index.jsp</code> inside a folder called <code>index</code> containing a navigation menu:</p>
<pre class="brush: java;">
...
&lt;%@ taglib uri=&quot;http://java.sun.com/jsp/jstl/core&quot; prefix=&quot;c&quot; %&gt;
...
&lt;a href=&quot;&lt;c:url value='/usuario/novo'/&gt;&quot;&gt;Novo usuário&lt;/a&gt;
...
</pre>
<p>Always use the core tag library to mount correctly URLs.</p>
<p>Ok! Now we can test the application. Add the project to the server and see the name will be <strong>vraptor-blank-project</strong>. This is the default name and we must use it to access the application: <code>http://localhost:8080/vraptor-blank-project/</code>. But we want to use another name, then I&#8217;ll show you how to change, because just rename the project&#8217;s folder wont solve the problem.</p>
<p><strong>Changing the name and deploy context-root of the application</strong>:</p>
<p>- View the hidden files in your project and you&#8217;ll see the folder <code>.settings</code>;<br />
- Open the file <code>org.eclipse.wst.common.component</code> in a text editor;<br />
- Change the property &#8220;<code>deploy-name</code>&#8221; to change the visually name of the application deploy;<br />
- Change the property &#8220;<code>context-root</code>&#8221; to change the access context of the application;<br />
- Choose the name that you think better and refresh de project and do the deploy again. I chose the name &#8220;vraptor&#8221;.</p>
<p><strong>Creating the registration page</strong> (novo.jsp)</p>
<p>We&#8217;ll create 1 Controller + 1 DAO + 1 folder containing the pages.</p>
<pre class="brush: java;">
...
&lt;form action=&quot;&lt;c:url value='/usuario'/&gt;&quot; method=&quot;post&quot;&gt;
    Nome: &lt;input type=&quot;text&quot; name=&quot;usuario.nome&quot; value=&quot;${usuario.nome}&quot;/&gt;
    Senha: &lt;input type=&quot;text&quot; name=&quot;usuario.senha&quot; value=&quot;${usuario.senha}&quot;/&gt;
    E-mail: &lt;input type=&quot;text&quot; name=&quot;usuario.email&quot; value=&quot;${usuario.email}&quot;/&gt;
    &lt;input type=&quot;submit&quot; value=&quot;Salvar&quot;/&gt;
&lt;/form&gt;
...
</pre>
<p>The form action access is <code>/usuario</code> using <code>POST</code>.<br />
The parameter <code>name</code> set the attributes of the <code>usuario</code>.<br />
The parameter <code>value</code>, retrieves the object <code>usuario</code> and use its to populate the fields.</p>
<p><strong>Creating the model</strong></p>
<pre class="brush: java;">
private Integer id;
private String nome;
private String senha;
private String email;

// Getters e Setters.
</pre>
<p>Remember that the attribute <code>name="usuario.nome"</code> access the <code>Usuario</code> and both the object and the attributes must exist.</p>
<p><strong>Creating the controller</strong></p>
<p>According the form&#8217;s action, we&#8217;ll create a method accessed by URI <code>/usuario</code> using <code>POST</code>.</p>
<pre class="brush: java;">
@Post
@Path(&quot;/usuario&quot;)
public void salvar() { }
</pre>
<p>There is still the object on which we set the values of the form fields. Unlike <code>useBean</code> of the JSP, the values are set in an object present in the actual controller, making it easer to use. This object just like any other must be present as an argument of the invoked method, more less like this:</p>
<pre class="brush: java;">
@Post
@Path(&quot;/usuario&quot;)
public void salvar(Usuario usuario) { }
</pre>
<p>With the object filled from form, we can persist it.</p>
<p><strong>Working with redirection</strong>:</p>
<p>If we try to save the user a 404 error will be throwed, because we&#8217;ll be redirected to a page with the same name of the method: <code>WEB-INF/jsp/usuario/salvar.jsp</code>, but if we wants to keep the method name, but to redirect to the page <code>listagem.jsp</code> we should do the redirect in the end of the method.</p>
<p>We have two redirects types:</p>
<p><strong>Results.logic()</strong></p>
<p>Redirect to a method of any controller. We must pass the controller class to the method:</p>
<pre class="brush: java;">
result.use(Results.logic()).redirectTo(UsuarioController.class).listagem();
</pre>
<p><code>UsuarioController.class</code> can be replaced by <code>getClass()</code> indicating the class itself, or any other.</p>
<p><strong>Results.page()</strong></p>
<p>Redirect to a page. Indicate the path of the page where we want to go. Its can be redirect or foward:</p>
<pre class="brush: java;">
result.use(Results.page()).forward(&quot;WEB-INF/jsp/listagem.jsp&quot;);
</pre>
<p>For more information about the difference between the two types of redirect, read the article <a href="http://www.rponte.com.br/2008/07/12/repitam-comigo-redirect-nao-e-forward/" target="_blank">Repitam Comigo Redirect Não é Forward</a> by <a href="http://twitter.com/rponte" target="_blank">Rafael Ponte</a>. (:</p>
<p>In recent versions of VRaptor you can use these methods briefly:</p>
<pre class="brush: java;">
result.redirectTo(this).listagem(); // Its can be a fowardTo
</pre>
<p>See the method already understood that <code>listagem</code> is a method, then is used the required <code>Results</code>. No longer need to specify if will be <code>logic</code> or <code>page</code>. It was also simplified the use of <code>getClass()</code> to simply <code>this</code>, representing the current controller.</p>
<p>Although there are several other types of <code>Results</code>, this is what we need for while.</p>
<p>Returning to the code, our controller should looks like this:</p>
<pre class="brush: java;">
@Resource
public class UsuarioController {

    private Result result;

    @Get
    @Path(&quot;/usuario/novo&quot;)
        public void novo() {
    }

    @Post
    @Path(&quot;/usuario&quot;)
    public void salvar(Usuario usuario) {
        // Method save here.
        result.forwardTo(&quot;WEB-INF/jsp/usuario/listagem.jsp&quot;);
    }
}
</pre>
<p>We must put the path of the pages starting from folder <code>WEB-INF</code>.</p>
<p><strong>Dependency Injection</strong></p>
<p>Certainly if we use the method <code>save</code> would be throwed a <code>NullPointerException</code>, because the object <code>result</code> is not instantiated. A great facility we have is dependency injection in which the object is injected through the class constructor and the framework control what is necessary for it.</p>
<pre class="brush: java;">
public UsuarioController(Result result) {
    this.result = result;
}
</pre>
<p>So now we have our <code>result</code> instantiated. Likewise if we want to work with other controllers, just inject it too.</p>
<blockquote><p>For best practices recommended to create interfaces with the signatures of the classes and pass it on injection instead of concrete classes, making it easier for unit tests, and having access to an external interface for your application.</p></blockquote>
<p><strong>Creating the DAO</strong></p>
<p>We need a persistence layer and this layer must be annotated with <code>@Component</code>. Components are instances of classes used by your application to perform tasks or store states in different ways. The DAO is a classic example.</p>
<p>For our example, only to facilitate didactically, we&#8217;ll use the class as session scope so that we can maintain the state and simulate the database. The existing scopes are:</p>
<p><strong>RequestScoped</strong>: avaliable only during the request;<br />
<strong>ApplicationScoped</strong>: avaliable only one by application;<br />
<strong>SessionScoped</strong>: will be the same during a http session; and<br />
<strong>PrototypeScoped</strong>: instantiated whenever requested.</p>
<pre class="brush: java;">
@SessionScoped
@Component
public class UsuarioDao {

    private List&lt;Usuario&gt; usuarioList = new ArrayList&lt;Usuario&gt;();
    private Integer id = 1;

    public void salvar(Usuario usuario) {
        usuarioList.add(usuario);
        usuario.setId(id++);
    }

}
</pre>
<p><strong>Listing data</strong>: (listagem.jsp)</p>
<p>To be able to list the information saved, we must pass this data through the <code>request</code>in which the VRaptor encapsulates, as well as <code>response</code>, making this task easier. The Result will be used to include the data as following:</p>
<pre class="brush: java;">
    result.include(&quot;usuarioList&quot;, usuarioList);
</pre>
<p>To get the list from request we can use <a href="http://en.wikipedia.org/wiki/Expression_Language" target="_blank">EL</a> as so: <code>${usuarioList}</code>.</p>
<pre class="brush: java;">
...
&lt;table&gt;
    &lt;thead&gt;
        &lt;tr&gt;
	    &lt;th&gt;Nome&lt;/th&gt;
            &lt;th&gt;Senha&lt;/th&gt;
	    &lt;th&gt;E-mail&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;c:forEach items=&quot;${usuarioList}&quot; var=&quot;item&quot;&gt;
            &lt;tr&gt;
                &lt;td&gt;${item.nome}&lt;/td&gt;
                &lt;td&gt;${item.senha}&lt;/td&gt;
                &lt;td&gt;${item.email}&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/c:forEach&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
...
</pre>
<p>In the above case, we&#8217;ve included the list in the request, but by default the return is already placed in the request. The return name is formed by the type of the list plus &#8220;List&#8221;: <code>public List<User> list();</code> would be captured as <code>${userList}</code>public User search(); would be captured as <code>${user}</code>.</p>
<p>Let&#8217;s add a method that returns the list in DAO:</p>
<pre class="brush: java;">
public List&lt;Usuario&gt; loadAll() {
    return usuarioList;
}
</pre>
<p>And in the controller too:</p>
<pre class="brush: java;">
@Get
@Path(&quot;/usuario&quot;)
public List&lt;Usuario&gt; listagem() {
    return usuarioDao.loadAll();
}
</pre>
<p>In the above method I&#8217;m using the default and letting it put the <code>usuarioList</code> on <code>resquest</code> as well the redirect to <code>listagem.jsp</code>.</p>
<p><strong>Creating logic to edit</strong></p>
<p>Let&#8217;s add a column in the listing table to put a link to edit:</p>
<pre class="brush: java;">
...
&lt;td&gt;
    &lt;form action=&quot;&lt;c:url value='/usuario'/&gt;&quot; method=&quot;post&quot;&gt;
        &lt;input type='hidden' name='_method' value='put'/&gt;
        &lt;input type='hidden' name='usuario.id' value='${item.id}'/&gt;
        &lt;input type=&quot;submit&quot; value=&quot;Editar&quot;/&gt;
    &lt;/form&gt;
&lt;/td&gt;
...
</pre>
<p>As our method is accessed by <code>PUT</code> we&#8217;ll have to do the form use it, since basically there&#8217;s &#8220;only&#8221; support as <code>GET</code> and <code>POST</code> in most of times. We should create a <code>hidden</code> field (that does not appear on the screen) overwriting the attribute <code>_method</code> with the value <code>PUT</code>, attribute that indicates which method the form will execute. The <code>id</code> attribute of object <code>Usuario</code> also is hidden to indicate which user we want to edit.</p>
<p>In our controller we have the following method:</p>
<pre class="brush: java;">
@Put
@Path(&quot;/usuario&quot;)
public void editar(Usuario usuario) {
    Usuario entity = usuarioDao.loadById(usuario);
    result.redirectTo(this).novo(entity);
}
</pre>
<p>Note that after we recover the user we want to edit and call the method <code>novo()</code>, because it will redirect to our form, but must take the user queried to the screen, then I pass him to the method that has been refactored to include it in the request:</p>
<pre class="brush: java;">
@Get
@Path(&quot;/usuario/novo&quot;)
public void novo(Usuario usuario) {
    result.include(&quot;usuario&quot;, usuario);
}
</pre>
<p>In DAO we&#8217;ll also add a method that finds the user by ID:</p>
<pre class="brush: java;">
public Usuario loadById(Usuario usuario) {
    Usuario usuarioDelete = null;

    for (Usuario item : usuarioList) {
        if (item.getId() == usuario.getId()) {
            usuarioDelete = item;
            break;
        }
    }

    removerItem(usuarioDelete); // *
    return usuarioDelete;
}
</pre>
<blockquote><p>* <code>removerItem(usuarioDelete)</code> is used here only because we don&#8217;t use a real database and the method edit actually remove and then save the user.</p></blockquote>
<p>Looking for a user with the same ID passed to the method, then immediately remove it from the list:</p>
<pre class="brush: java;">
private void removerItem(Usuario usuarioDelete) {
    if (usuarioList.remove(usuarioDelete)) {
        id--;
    }
}
</pre>
<blockquote><p>If we give up to save the user, its will be removed anyway, but the example is symbolic.</p>
</blockquote>
<p><strong>Creating the exclusion logic</strong></p>
<p>The delete method follows the same logic of the edit, but don&#8217;t need to return the data to the screen.<br />
Let&#8217;s add a column in the listing table and put a link to the delete method:</p>
<pre class="brush: java;">
&lt;td&gt;
    &lt;form action='&lt;c:url value=&quot;/usuario&quot;/&gt;' method=&quot;post&quot;&gt;
        &lt;input type='hidden' name='_method' value='delete/&gt;
        &lt;input type='hidden' name='usuario.id' value='${item.id}'/&gt;
        &lt;input type=&quot;submit&quot; value=&quot;Excluir&quot;/&gt;
    &lt;/form&gt;
&lt;/td&gt;
</pre>
<p>Let&#8217;s create a method annotated with <code>@Delete </code> in the controller:</p>
<pre class="brush: java;">
@Delete
@Path(&quot;/usuario&quot;)
public void remover(Usuario usuario) {
    usuarioDao.remover(usuario);
    result.redirectTo(this).listagem();
}
</pre>
<p>And then we pass to DAO remove the object:</p>
<pre class="brush: java;">
public void remover(Usuario usuario) {
    Usuario usuarioDelete = null;

    for (Usuario item : usuarioList) {
        if (item.getId() == usuario.getId()) {
            usuarioDelete = item;
            break;
        }
    }

    removerItem(usuarioDelete);
}
</pre>
<p>The above method search the user by ID, keep it and remove it from the list. In a real situation the object must be removed from the database according to the ID passed.</p>
<p><strong>Conclusion</strong></p>
<p>In a easily way we created a CRUD without worry about requisitions, data conversion and redirects. We can do that and more with VRaptor. And if you worry about the the visuals work just take a look at <a href="http://jqueryui.com/" target="_blank">jQuery UI</a>.</p>
<p>For those who wish to lear more about VRaptor, follow the <a href="http://groups.google.com/group/caelum-vraptor" target="_blank">discussion list</a>, take a look at <a href="http://vraptor.caelum.com.br/documentacao" target="_blank">official documentation</a> available in Portuguese either or continue to follow the articles here at <a href="http://wbotelhos.com.br" target="_blank">Blog</a>.</p>
<p>See this code running on: <a href="http://www.moviecollection.com.br" target="_blank">http://moviecollection.com.br</a></p>
<p><strong>Project link</strong>:</p>
<p><a href="http://github.com/wbotelhos/iniciando-com-vraptor-3" target="_blank">http://github.com/wbotelhos/iniciando-com-vraptor-3</a></p></blockquote>



<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2010%2F11%2F24%2Fgetting-started-with-vraptor-3%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2010%2F11%2F24%2Fgetting-started-with-vraptor-3%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></content:encoded>
			<wfw:commentRss>http://www.wbotelhos.com/2010/11/24/getting-started-with-vraptor-3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jQuery Raty &#8211; A Star Rating Plugin</title>
		<link>http://www.wbotelhos.com/2010/07/14/jquery-raty-a-star-rating-plugin/</link>
		<comments>http://www.wbotelhos.com/2010/07/14/jquery-raty-a-star-rating-plugin/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 17:01:41 +0000</pubDate>
		<dc:creator>wbotelhos</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Plugin]]></category>

		<guid isPermaLink="false">http://www.wbotelhos.com/?p=684</guid>
		<description><![CDATA[jQuery Raty is a plugin that generates a customizable star rating.


<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2010%2F07%2F14%2Fjquery-raty-a-star-rating-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2010%2F07%2F14%2Fjquery-raty-a-star-rating-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></description>
			<content:encoded><![CDATA[<p><a href="http://wbotelhos.com/raty" target="_blank" style="14px verdana;">jQuery Raty</a> is a plugin that generates a customizable star rating. <b>(<a href="http://www.wbotelhos.com/raty" target="_blank">Demo</a>)</b></p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Required files:
</div>
<p>+ jquery.raty.min.js<br />
+ star-on.png<br />
+ star-off.png</p>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 20px; margin-top: 20px;">
    Default configuration:
</div>
<pre class="brush: jscript;">
$('#star').raty();
</pre>
<pre class="brush: xml;">
&lt;div id=&quot;star&quot;&gt;&lt;/div&gt;
</pre>
<div style="color: #7A7A7A; font: bold 14px arial; margin-bottom: 10px; margin-top: 20px;">
    Demo:
</div>
<p><a href="http://www.wbotelhos.com/raty" target="_blank">http://wbotelhos.com/raty</a></p>
<div style="color: #F00; font: bold 16px arial; margin-bottom: 10px; margin-top: 20px;">
    Please:
</div>
<p>- Format your code before paste it here, I will probably have to read it;<br />
- Use code formatter to write it:</p>
<div style="font: 14px monospace; margin-bottom: 20px;">
    <b><span>[</span>source language="javascript"]</b><i>your_code_here</i><b>[/source<span>]</span></b>
</div>



<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2010%2F07%2F14%2Fjquery-raty-a-star-rating-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->



  
   Tweet
  

 
<!-- Start WP Socializer Plugin - Facebook Button -->
<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.wbotelhos.com%2F2010%2F07%2F14%2Fjquery-raty-a-star-rating-plugin%2F" target="_blank">Share on Facebook</a>
<!-- End WP Socializer Plugin - Facebook Button -->

]]></content:encoded>
			<wfw:commentRss>http://www.wbotelhos.com/2010/07/14/jquery-raty-a-star-rating-plugin/feed/</wfw:commentRss>
		<slash:comments>206</slash:comments>
		</item>
	</channel>
</rss>

