<?xml version="1.0"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Planeta NetBeans</title>
    <link>http://www.planetnetbeans.org/pt_br/</link>
    <language>pt</language>
    <description>Planeta NetBeans - http://www.planetnetbeans.org/pt_br/</description>
    <item>
      <title>Silveira Neto » netbeans: JavaFX, Duke Potato</title>
      <guid isPermaLink="false">http://silveiraneto.net/?p=1327</guid>
      <link>http://silveiraneto.net/2008/10/04/javafx-duke-potato/</link>
      <description>&lt;p&gt;Do you know the toy &lt;a href="http://en.wikipedia.org/wiki/Mr_potato_head" title="Wikipédia, inglês"&gt;Mr. Potato Head&lt;/a&gt;? Now meet the Java Potato.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;/p&gt; &lt;p&gt;Duke images here from &lt;a href="http://silveiraneto.net/tag/duke" title="Dukes"&gt;previous dukes I posted&lt;/a&gt; and other images from &lt;a href="http://openclipart.org/" title="Open Clipart"&gt;Open Clipart Project&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;The
      code:&lt;/p&gt; &lt;div class="wp_syntax"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="line_numbers"&gt;&lt;pre&gt;1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 &lt;/pre&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre style="font-family: monospace;" class="java java"&gt;&lt;span
      style="color: #000000; font-weight: bold;"&gt;package&lt;/span&gt; &lt;span style="color: #006699;"&gt;dukepotato&lt;/span&gt;; &#160; &lt;span style="color: #000000; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: #006699;"&gt;javafx.application.Frame&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: #006699;"&gt;javafx.application.Stage&lt;/span&gt;; &lt;span style="color: #000000; font-weight:
      bold;"&gt;import&lt;/span&gt; &lt;span style="color: #006699;"&gt;javafx.scene.CustomNode&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: #006699;"&gt;javafx.scene.Node&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: #006699;"&gt;javafx.scene.Group&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color:
      #006699;"&gt;javafx.input.MouseEvent&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: #006699;"&gt;javafx.scene.geometry.Circle&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: #006699;"&gt;javafx.scene.paint.Color&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color:
      #006699;"&gt;javafx.scene.image.ImageView&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;import&lt;/span&gt; &lt;span style="color: #006699;"&gt;javafx.scene.image.Image&lt;/span&gt;; &#160; &lt;span style="color: #000000; font-weight: bold;"&gt;public&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;class&lt;/span&gt; Img &lt;span style="color: #000000; font-weight: bold;"&gt;extends&lt;/span&gt; ImageView&lt;span style="color: #009900;"&gt;{&lt;/span&gt;
      &lt;span style="color: #000000; font-weight: bold;"&gt;public&lt;/span&gt; attribute content&lt;span style="color: #339933;"&gt;:&lt;/span&gt; Node&lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;public&lt;/span&gt; attribute src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #003399;"&gt;String&lt;/span&gt;; &#160; &lt;span style="color: #000000; font-weight:
      bold;"&gt;private&lt;/span&gt; attribute endX &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;0.0&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;private&lt;/span&gt; attribute endY &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;0.0&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;private&lt;/span&gt; attribute startX &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span
      style="color: #cc66cc;"&gt;0.0&lt;/span&gt;; &lt;span style="color: #000000; font-weight: bold;"&gt;private&lt;/span&gt; attribute startY &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;0.0&lt;/span&gt;; &#160; override attribute translateX &lt;span style="color: #339933;"&gt;=&lt;/span&gt; bind endX; override attribute translateY &lt;span style="color: #339933;"&gt;=&lt;/span&gt; bind endY; override attribute blocksMouse &lt;span style="color:
      #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #000066; font-weight: bold;"&gt;true&lt;/span&gt;; &#160; init &lt;span style="color: #009900;"&gt;{&lt;/span&gt; image &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #003399;"&gt;Image&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt; url&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"{__DIR__}/{src}"&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt;
      &lt;span style="color: #009900;"&gt;}&lt;/span&gt; &#160; override attribute onMousePressed &lt;span style="color: #339933;"&gt;=&lt;/span&gt; function&lt;span style="color: #009900;"&gt;(&lt;/span&gt;e&lt;span style="color: #339933;"&gt;:&lt;/span&gt;&lt;span style="color: #003399;"&gt;MouseEvent&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;:&lt;/span&gt;&lt;span style="color: #003399;"&gt;Void&lt;/span&gt; &lt;span style="color:
      #009900;"&gt;{&lt;/span&gt; startX &lt;span style="color: #339933;"&gt;=&lt;/span&gt; e.&lt;span style="color: #006633;"&gt;getDragX&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;-&lt;/span&gt;endX; startY &lt;span style="color: #339933;"&gt;=&lt;/span&gt; e.&lt;span style="color: #006633;"&gt;getDragY&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color:
      #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;-&lt;/span&gt;endY; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; &#160; override attribute onMouseDragged &lt;span style="color: #339933;"&gt;=&lt;/span&gt; function&lt;span style="color: #009900;"&gt;(&lt;/span&gt;e&lt;span style="color: #339933;"&gt;:&lt;/span&gt;&lt;span style="color: #003399;"&gt;MouseEvent&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;:&lt;/span&gt;&lt;span
      style="color: #003399;"&gt;Void&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt; endX &lt;span style="color: #339933;"&gt;=&lt;/span&gt; e.&lt;span style="color: #006633;"&gt;getDragX&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;-&lt;/span&gt;startX; endY &lt;span style="color: #339933;"&gt;=&lt;/span&gt; e.&lt;span style="color: #006633;"&gt;getDragY&lt;/span&gt;&lt;span
      style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;-&lt;/span&gt;startY; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; &#160; var dukesimages &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #009900;"&gt;[&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;"duke1.png"&lt;/span&gt;, &lt;span style="color: #0000ff;"&gt;"duke2.png"&lt;/span&gt;,
      &lt;span style="color: #0000ff;"&gt;"duke3.png"&lt;/span&gt;, &lt;span style="color: #0000ff;"&gt;"duke4.png"&lt;/span&gt;&lt;span style="color: #009900;"&gt;]&lt;/span&gt;; var dukes &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #000000; font-weight: bold;"&gt;for&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;image in dukesimages&lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #009900;"&gt;{&lt;/span&gt; &lt;span style="color:
      #003399;"&gt;Image&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt; url&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"{__DIR__}/{image}"&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var index &lt;span style="color: #339933;"&gt;=&lt;/span&gt; 0; var duke &lt;span style="color: #339933;"&gt;=&lt;/span&gt; ImageView &lt;span style="color: #009900;"&gt;{&lt;/span&gt; x&lt;span
      style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;200&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt;&lt;span style="color: #cc66cc;"&gt;170&lt;/span&gt; image&lt;span style="color: #339933;"&gt;:&lt;/span&gt; bind dukes&lt;span style="color: #009900;"&gt;[&lt;/span&gt;index&lt;span style="color: #009900;"&gt;]&lt;/span&gt;; onMouseClicked&lt;span style="color: #339933;"&gt;:&lt;/span&gt; function&lt;span style="color: #009900;"&gt;(&lt;/span&gt;
      e&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #003399;"&gt;MouseEvent&lt;/span&gt; &lt;span style="color: #009900;"&gt;)&lt;/span&gt;&lt;span style="color: #339933;"&gt;:&lt;/span&gt;&lt;span style="color: #003399;"&gt;Void&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt; index &lt;span style="color: #339933;"&gt;=&lt;/span&gt; &lt;span style="color: #009900;"&gt;(&lt;/span&gt;index &lt;span style="color: #339933;"&gt;+&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;1&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; mod sizeof dukesimages; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; &#160; var hat &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"hat.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span
      style="color: #cc66cc;"&gt;370&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var partyhat &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"party_hat.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;160&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span
      style="color: #cc66cc;"&gt;5&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var cap &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"cap.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;230&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;10&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var cake &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"cake.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;526&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;190&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var glove &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"glove.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;338&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;363&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var baseball &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"baseball.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;548&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt;&lt;span style="color:
      #cc66cc;"&gt;373&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var pencil &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"pencil.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;451&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;365&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var camera &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"camera.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;125&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;380&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var coffee &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"coffee.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;541&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;114&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var burger &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"burger.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;542&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;282&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var diamond &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"diamond.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;243&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;383&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var pliers &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"pliers.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;20&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;368&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var rubikcube &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src &lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"rubikcube.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;37&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;295&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var syringe &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"syringe.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;35&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;245&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var hourglass &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"hourglass.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;35&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color:
      #cc66cc;"&gt;127&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var adventurehat &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"adventurehat.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;8&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt;&lt;span style="color:
      #cc66cc;"&gt;30&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; var tie &lt;span style="color: #339933;"&gt;=&lt;/span&gt; Img &lt;span style="color: #009900;"&gt;{&lt;/span&gt; src&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"tie.png"&lt;/span&gt;, x&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;547&lt;/span&gt;, y&lt;span style="color: #339933;"&gt;:&lt;/span&gt;&lt;span style="color:
      #cc66cc;"&gt;35&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; &#160; &#160; &lt;span style="color: #003399;"&gt;Frame&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt; title&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;"Duke Potato"&lt;/span&gt; width&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #cc66cc;"&gt;640&lt;/span&gt; height&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span
      style="color: #cc66cc;"&gt;480&lt;/span&gt; closeAction&lt;span style="color: #339933;"&gt;:&lt;/span&gt; function&lt;span style="color: #009900;"&gt;(&lt;/span&gt;&lt;span style="color: #009900;"&gt;)&lt;/span&gt; &lt;span style="color: #009900;"&gt;{&lt;/span&gt; java.&lt;span style="color: #006633;"&gt;lang&lt;/span&gt;.&lt;span style="color: #003399;"&gt;System&lt;/span&gt;.&lt;span style="color: #006633;"&gt;exit&lt;/span&gt;&lt;span style="color: #009900;"&gt;(&lt;/span&gt; 0 &lt;span
      style="color: #009900;"&gt;)&lt;/span&gt;; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; visible&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #000066; font-weight: bold;"&gt;true&lt;/span&gt; &#160; stage&lt;span style="color: #339933;"&gt;:&lt;/span&gt; Stage &lt;span style="color: #009900;"&gt;{&lt;/span&gt; content&lt;span style="color: #339933;"&gt;:&lt;/span&gt; &lt;span style="color: #009900;"&gt;[&lt;/span&gt;duke, hat, partyhat, cake, adventurehat, cap, glove,
      baseball, pencil, camera, coffee, burger, diamond, pliers, rubikcube, syringe, hourglass, tie&lt;span style="color: #009900;"&gt;]&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt; &lt;span style="color: #009900;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt; &lt;ul&gt; &lt;li&gt;Lines 14 to 42 is the same dragging approach I showed in the post &lt;a href="http://silveiraneto.net/2008/08/11/javafx-draggable-node/"&gt;Draggable
      Nodes&lt;/a&gt;, but this time creating a class that inherits the behavior of ImageView.&lt;/li&gt; &lt;li&gt;Lines 44 to 57 is the Duke that changes when you click on it. It cycles over the dukesimages list.&lt;/li&gt; &lt;li&gt;Lines 59 to 75 is just instantiations of all toys and objects we will use to dress the Duke. Look how easier was to create and place a image.&lt;/li&gt; &lt;li&gt;Lines 78 to the end is just creating a Frame and putting all elements on it.&lt;/li&gt; &lt;/ul&gt;
      &lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt; a package with the NetBeans project, sources, libraries and images, &lt;a href="http://silveiraneto.net/downloads/DukePotato.tar.gz"&gt;DukePotato.tar.gz&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Sat, 04 Oct 2008 19:04:01 +0000</pubDate>
    </item>
    <item>
      <title>Paulo Canedo » NetBeans pt_BR: O NetBeans 6.5 já fala português</title>
      <guid isPermaLink="false">http://www.paulocanedo.com.br/?p=64</guid>
      <link>http://www.paulocanedo.com.br/2008/10/03/o-netbeans-65-ja-fala-portugues/</link>
      <description>&lt;p&gt;A partir de agora o NetBeans terá sua tradução disponível a partir de plugins os quais já estão disponíveis para instalação.&lt;/p&gt; &lt;p&gt;Se você deseja instalar o plugin de localização para português basta acessar: Tools-&gt;Plugins, em seguida clique na aba Settings e adicione o seguinte Update Center:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Name:&lt;/strong&gt; &lt;span style="color: #008000;"&gt;Localization UC&lt;/span&gt;&lt;br /&gt; &lt;strong&gt;URL para NetBeans
      6.5:&lt;/strong&gt; &lt;span style="color: #008000;"&gt;http://deadlock.netbeans.org/hudson/job/nb6.5-community-ml/lastSuccessfulBuild/artifact/l10n/nbms/community/catalog_all.xml.gz&lt;br /&gt; &lt;/span&gt;&lt;strong&gt;URL para NetBeans 6.1:&lt;/strong&gt;&lt;span style="color: #008000;"&gt; &lt;/span&gt;&lt;span style="color: #008000;"&gt;http://deadlock.netbeans.org/hudson/job/nb6.1-community-ml/lastSuccessfulBuild/artifact/l10n/nbms/community/catalog_all.xml.gz&lt;br /&gt;
      &lt;/span&gt;&lt;strong&gt;URL para NetBeans 6.0:&lt;/strong&gt;&lt;span style="color: #008000;"&gt; &lt;/span&gt;&lt;span style="color: #008000;"&gt;http://deadlock.netbeans.org/hudson/job/nb6-community-ml/lastSuccessfulBuild/artifact/nbbuild/dist/nbms/catalog_all.xml.gz &lt;/span&gt;&lt;/p&gt; &lt;div style="width: 564px;" id="attachment_59" class="wp-caption alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/wp-content/uploads/2008/10/nb65_localization_plugins_new.png"
      title="nb65_localization_plugins_new" height="189" width="554" alt="NetBeans 6.5 - Adicionando novo Update Center" class="size-full wp-image-59" /&gt;&lt;p class="wp-caption-text"&gt;NetBeans 6.5 - Adicionando novo Update Center&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Agora vá até a aba Available Plugins e digite pt_BR no campo Search e instale o plugin&lt;/p&gt; &lt;div style="width: 559px;" id="attachment_60" class="wp-caption alignnone"&gt;&lt;a
      href="http://www.paulocanedo.com.br/wp-content/uploads/2008/10/nb65_plugins_localization_available.png"&gt;&lt;img src="http://www.paulocanedo.com.br/wp-content/uploads/2008/10/nb65_plugins_localization_available.png" title="nb65_plugins_localization_available" height="359" width="549" alt="NetBeans 6.5 - Instalar plugin de localização" class="size-medium wp-image-60" /&gt;&lt;/a&gt;&lt;p class="wp-caption-text"&gt;NetBeans 6.5 - Instalar plugin de localização&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Agora
      basta reiniciar o IDE para ter seu IDE em português!&lt;/p&gt; &lt;p&gt;&lt;img src="http://www.paulocanedo.com.br/wp-content/uploads/2008/10/nb65_localization_pt_br.gif" title="NetBeans 6.5 em português" height="423" width="362" alt="" class="alignnone size-medium wp-image-61" /&gt;&lt;/p&gt; &lt;p&gt;Se você quiser também pode forçar o idioma que o NetBeans deve carregar, você pode editar o arquivo $NB_INSTALACAO/etc/netbeans.conf ou executar o lançador do netbeans com o parâmetro extra: –locale.
      Para forçar o idioma em português por exemplo: –locale pt:BR&lt;/p&gt; &lt;p&gt;Links:&lt;/p&gt; &lt;p&gt;&lt;a href="http://wiki.netbeans.org/FaqNetbeansConf"&gt;http://wiki.netbeans.org/FaqNetbeansConf&lt;/a&gt;&lt;br /&gt; &lt;a href="http://wiki.netbeans.org/TFLocalizationDevelopmentUC#section-TFLocalizationDevelopmentUC-AccessingTheL10nUC"&gt;http://wiki.netbeans.org/TFLocalizationDevelopmentUC#section-TFLocalizationDevelopmentUC-AccessingTheL10nUC&lt;/a&gt;&lt;br /&gt; &lt;a
      href="http://blogs.sun.com/katakai/entry/l10n_dev_l10n_uc_6"&gt;http://blogs.sun.com/katakai/entry/l10n_dev_l10n_uc_6&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 03 Oct 2008 12:55:48 +0000</pubDate>
    </item>
    <item>
      <title>adourado: NetBeans Innovators Grants Na Pagina Principal do Netbeans.org</title>
      <guid isPermaLink="false">http://www.softag.com.br/roller/adourado/entry/netbeans_innovators_grants_na_pagina</guid>
      <link>http://www.softag.com.br/roller/adourado/entry/netbeans_innovators_grants_na_pagina</link>
      <description>&lt;p&gt;Agora ficou bonito!! O anúncio dos vencedores do &lt;a href="http://www.netbeans.org/grant" target="_blank"&gt;NetBeans Innovators Grants&lt;/a&gt; ganhou destaque na página principal do &lt;a href="http://www.netbeans.org" target="_blank"&gt;www.netbeans.org&lt;/a&gt;. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&#160; &lt;a href="http://www.softag.com.br/roller/adourado/resource/netbeans/pagina_inicial.png" target="_blank" title="Ampliar imagem"&gt;&lt;img
      src="http://www.softag.com.br/roller/adourado/resource/netbeans/pagina_inicial.png" style="width: 415px; height: 315px;" hspace="0" align="baseline" vspace="0" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Ao&#160; mesmo tempo foi liberado no &lt;a href="http://www.netbeans.tv/" target="_blank"&gt;Netbeans tv&lt;/a&gt; uma entrevista como cordenador do &lt;a href="http://www.netbeans.org/grant" target="_blank"&gt;NetBeans Innovators Grants&lt;/a&gt;&#160; Jirka Kovalsky falando do projeto. Ouça
      abaixo:&lt;/p&gt; &lt;p&gt;&#160;&lt;/p&gt;&lt;div id="videoPlayer"&gt;&lt;/div&gt; &lt;p&gt;&#160;&lt;/p&gt;&lt;p&gt;Ou acesse o link: &lt;a href="http://www.netbeans.tv/podcasts/Jirka-Kovalksy-on-NetBeans-Innovators-Grants-387/" target="_blank"&gt;http://www.netbeans.tv/podcasts/Jirka-Kovalksy-on-NetBeans-Innovators-Grants-387/&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 02 Oct 2008 11:41:23 +0000</pubDate>
    </item>
    <item>
      <title>adourado: Repercussao da premiacao do Netbeans Innovators Grant no Sun Tech Days em Sao Paulo</title>
      <guid isPermaLink="false">http://www.softag.com.br/roller/adourado/entry/repercussao_da_premiacao_do_netbeans</guid>
      <link>http://www.softag.com.br/roller/adourado/entry/repercussao_da_premiacao_do_netbeans</link>
      <description>&lt;p&gt;&lt;img src="http://www.softag.com.br/roller/adourado/resource/sun_tech_fotos/IMG_3600.JPG" align="baseline" border="0" vspace="0" hspace="0" /&gt;&#160;&lt;img src="http://www.softag.com.br/roller/adourado/resource/sun_tech_fotos/IMG_3646.JPG" align="baseline" border="0" vspace="0" hspace="0" /&gt;&lt;/p&gt;&lt;p&gt; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;A premiação que aconteceu na manha do primeiro dia (29/09/2008) do Sun Tech Days 2008&#160; em São Paulo gerou uma grande
      repercussão no mundo e foi destaque em vários blogs e sites de jornais e revistas. Nem preciso falar que o número de visitantes ao site do projeto aumentou consideravelmente. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Em uma busca rápida no google encontrei essas noticias: &lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;&lt;a href="http://www.baguete.com.br/noticiasDetalhes.php?id=28884" target="_blank"&gt; http://www.baguete.com.br/noticiasDetalhes.php?id=28884&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
      href="http://blogs.sun.com/arungupta/entry/sun_tech_days_2008_sao" target="_blank"&gt;http://blogs.sun.com/arungupta/entry/sun_tech_days_2008_sao&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.sun.com/aboutsun/pr/2008-09/sunflash.20080929.4.xml" target="_blank"&gt;http://www.sun.com/aboutsun/pr/2008-09/sunflash.20080929.4.xml&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.tradingmarkets.com/.site/news/Stock%20News/1908093/"
      target="_blank"&gt;http://www.tradingmarkets.com/.site/news/Stock%20News/1908093/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://finance.boston.com/boston?GUID=6699972&amp;amp;Page=MediaViewer&amp;amp;ChannelID=3191" target="_blank"&gt;http://finance.boston.com/boston?GUID=6699972&amp;amp;Page=MediaViewer&amp;amp;ChannelID=3191&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
      href="http://www.ariva.de/Sun_Microsystems_and_the_NetBeans_Community_Kick_Off_World_Tour_and_Announce_NetBeans_Innovators_Grant_Winners_n2756794" target="_blank"&gt;http://www.ariva.de/Sun_Microsystems_and_the_NetBeans_Community_Kick_Off_World_Tour_and_Announce_NetBeans_Innovators_Grant_Winners_n2756794&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://news.moneycentral.msn.com/ticker/article.aspx?Feed=BW&amp;amp;Date=20080929&amp;amp;ID=9201549&amp;amp;Symbol=JAVA"
      target="_blank"&gt;http://news.moneycentral.msn.com/ticker/article.aspx?Feed=BW&amp;amp;Date=20080929&amp;amp;ID=9201549&amp;amp;Symbol=JAVA&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.reuters.com/article/idUS134098+29-Sep-2008+BW20080929" target="_blank"&gt;http://www.reuters.com/article/idUS134098+29-Sep-2008+BW20080929&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.opennet.ru/opennews/art.shtml?num=18161"
      target="_blank"&gt;http://www.opennet.ru/opennews/art.shtml?num=18161&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://ca.news.finance.yahoo.com/s/29092008/34/biz-f-business-wire-sun-microsystems-netbeans-community-kick-world-tour-announce.html" target="_blank"&gt;http://ca.news.finance.yahoo.com/s/29092008/34/biz-f-business-wire-sun-microsystems-netbeans-community-kick-world-tour-announce.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
      href="http://money.aol.com/news/articles/_a/sun-microsystems-and-the-netbeans/rfid144238885" target="_blank"&gt;http://money.aol.com/news/articles/_a/sun-microsystems-and-the-netbeans/rfid144238885&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.ad-hoc-news.de/Sun-Microsystems-and-the-NetBeans-Community-Kick-Off-World--/de/Unternehmensnachrichten/19700849"
      target="_blank"&gt;http://www.ad-hoc-news.de/Sun-Microsystems-and-the-NetBeans-Community-Kick-Off-World--/de/Unternehmensnachrichten/19700849&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.tmcnet.com/usubmit/2008/09/29/3674913.htm" target="_blank"&gt;http://www.tmcnet.com/usubmit/2008/09/29/3674913.htm&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://blogs.sun.com/wen/entry/congratulations_to_the_netbeans_innovators"
      target="_blank"&gt;http://blogs.sun.com/wen/entry/congratulations_to_the_netbeans_innovators&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.google.com.br/search?q=%22alessandro+nascimento+dourado%22+sun" target="_blank"&gt;http://www.google.com.br/search?q=%22alessandro+nascimento+dourado%22+sun&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&#160;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Vencedores&#160; Brasileiros do NetBeans Innovators Grant&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;img
      src="http://www.softag.com.br/roller/adourado/resource/sun_tech_fotos/IMG_0863.jpg" border="0" align="baseline" height="438" width="584" vspace="0" hspace="0" /&gt; &lt;/p&gt;&lt;p&gt; Thiago (Sun Spot), Carlos e Hugo (Monoh), Alessandro (NB project).&#160; O outro recebeu o prêmio por OpenSolaris/Glassfish. &lt;/p&gt;</description>
      <pubDate>Thu, 02 Oct 2008 01:51:10 +0000</pubDate>
    </item>
    <item>
      <title>Controverso eu ? - NetBeans category: NetBeans 6.5 saindo ou entrando no forno ?</title>
      <guid isPermaLink="false">http://www.go-java.com:80/blog/2008/09/25/1222359888883.html</guid>
      <link>http://www.go-java.com:80/blog/2008/09/25/1222359888883.html</link>
      <description>&lt;p&gt;De acordo com o time de qualidade, o NetBeans 6.5 teve sua da de lançamento alterada, o CODE FREEZE está agora planejado para 13 de outubro e a versão final para 12 de novembro. Meio chato mas necessario , segundo eles estão recebendo cerca de 400 bugs por semana, e para entregar algo realmente de qualidade vão precisar de mais algum tempinho arrumando ehehe...&lt;/p&gt; &lt;p&gt;Mais informações &lt;a href="http://wiki.netbeans.org/NB65Milestones"&gt;aqui&lt;/a&gt;.&lt;/p&gt;
      &lt;p&gt;Abaixo o email original:&lt;/p&gt; Jirka Kovalsky (NetBeans Technical Community Manager ) say: &lt;p&gt;&lt;em&gt;Hello developers,&lt;br /&gt; &lt;br /&gt; based on the current quality dashboard and feedback from community, a change to the NetBeans 6.5 release schedule [1] has been made. We went through all problematic areas and investigated how much time is needed to meet the FCS quality and according to our findings 4 more weeks will be required. &lt;br /&gt; This in particular means that
      &lt;strong&gt;Code Freeze moves to October 13th and FCS to November 12th&lt;/strong&gt;. &lt;br /&gt; &lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;It is not easy to postpone the release date but we simply want to address recent community feedback coming for example via this mailing list or via bugs that were submitted at high rate of ~400 issues weekly. &lt;br /&gt; However, &lt;strong&gt;we believe it will pay off in the end because quality is also a feature, isn't it?&lt;/strong&gt; :-) &lt;br /&gt;
      &lt;br /&gt; Thanks for your understanding and support! &lt;/em&gt;&lt;/p&gt; &lt;p&gt;&#160;&lt;/p&gt; &lt;p&gt;&#160;&lt;/p&gt;</description>
      <pubDate>Thu, 25 Sep 2008 16:24:48 +0000</pubDate>
    </item>
    <item>
      <title>NetFeijão Brazil: [JavaEE 6] EJB 3.1 no GlassFish V3 e NetBeans</title>
      <guid isPermaLink="false">tag:blogger.com,1999:blog-544668644670311424.post-6621722062697098719</guid>
      <link>http://netfeijao.blogspot.com/2008/09/javaee-6-ejb-31-no-glassfish-v3-e.html</link>
      <description>&lt;a href="http://4.bp.blogspot.com/_6CJaDmsVepU/SNAH_mQTVfI/AAAAAAAAATM/lDpZo6sjWXk/s1600-h/ed31_destaques.jpg"&gt;&lt;img src="http://4.bp.blogspot.com/_6CJaDmsVepU/SNAH_mQTVfI/AAAAAAAAATM/lDpZo6sjWXk/s320/ed31_destaques.jpg" alt="" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand;" border="0" id="BLOGGER_PHOTO_ID_5246702355068704242" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Esta semana saiu nas bancas a&lt;span style="font-weight:
      bold;"&gt; edição 31&lt;/span&gt; da revista &lt;a href="http://www.mundojava.com.br/"&gt;Mundo Java&lt;/a&gt; com o título "&lt;span style="font-weight: bold;"&gt;Futuro do Java Corporativo"&lt;/span&gt;, com um artigo meu sobre o mesmo tema.&lt;br /&gt;Para quem quer saber o que vai rolar na próxima especificação do Java EE 6, está edição está um prato cheio, portanto compre uma edição e aproveite...&lt;br /&gt;Não vou entrar em muitos detalhes da matéria, mas vou descrever aqui melhor a demo que
      está na revista, onde apresento uma aplicação utilizando Session Bean da especificação de EJB 3.1 no GlassFish V3.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Instalando o GlassFish V3 e o conteiner EJB&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;No &lt;a href="https://glassfish.dev.java.net/downloads/v3-techPreview-1.html"&gt;site do GlassFish&lt;/a&gt; baixe o arquivo zip e descompacte em um diretório da sua escolha, a partir deste momento vamos chamar apenas de GLASSFISH_HOME\bin e
      execute o updatetool (Figura 1).&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_6CJaDmsVepU/SM25WJx368I/AAAAAAAAASs/QqzCCqlXUgY/s1600-h/glassfishV3.jpg"&gt;&lt;img src="http://3.bp.blogspot.com/_6CJaDmsVepU/SM25WJx368I/AAAAAAAAASs/QqzCCqlXUgY/s320/glassfishV3.jpg" alt="" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" id="BLOGGER_PHOTO_ID_5246052931189861314" /&gt;&lt;/a&gt; Na opção available addons, selecione glassfishv3-ejb e clique em Install, esta
      ação irá instalar o container EJB no Glassfish.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Instalando o plugin GlassFish V3 no NetBeans&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; Agora inicie o NetBeans (de preferência a versão 6.1 ou 6.5) e instale o plugin do GlassFish V3 para o NetBeans em Ferramentas | Plugins, selecione em plugins disponíveis "Glassfish JavaEE Integration" e clique em instalar.&lt;br /&gt;Após instaldo o plugin, na aba Serviços, adicione um novo servidor, selecione
      a opção GlassFish V3 e siga os passos apontando o diretório GLASSFISH_HOME de instalação e finalizar.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Vamos explorar agora uma funcionalidade no NetBeans para a criação de CRUD, crie uma nova Aplicação Web na categoria Web e clique em Próximo.&lt;br /&gt;Neste passo digite "DEMO_EJB31" e clique em Próximo, na opção servidores selecione o servidor GlassFish V3 T2 recém instalado e clique em Próximo. No último passo selecione o framework JavaServer Faces e
      clique em Finalizar.&lt;br /&gt;&lt;br /&gt;Agora vamos criar uma aplicação CRUD completa baseada em uma entidade de banco de dados, para isso clique em Arquivo | Novo Arquivo, na categoria Persistence selecione a opção "Classes de entidade do banco de dados" e clique em Próximo.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;OBS:&lt;/span&gt; Antes de fazer o passo abaixo, inicie o banco de dados Derby na guia Serviços do NetBeans, clique com o botão direito do mouse em Java DB e clique em
      "Iniciar Servidor".&lt;br /&gt;&lt;br /&gt;Neste segundo passo, na lista Fonte de Dados selecione a opção "Nova Fonte de Dados", no campo "Nome JNDI" digite jndi/TesteEJB e na lista "Conexão de banco de dados" selecione o banco "jdbc:derby://localhost:1527/vir" já existente e clique em OK.&lt;br /&gt;&lt;br /&gt;Se tudo ocorreu de maneira correta será apresentada uma lista de tabelas disponíveis. Selecione a tabela Employee, clique em Adicionar e em seguida clique em Próximo.&lt;br /&gt;&lt;br
      /&gt;No campo nome do pacote digite br.com.netfeijao.entities e por fim clique no botão "Criar unidade de persistência". Mantenha os valores default clique em Criar e depois clique em Finalizar. Esta ação irá criar a classe persistente Employee no pacote informado.&lt;br /&gt;&lt;br /&gt;Agora vamos utilizar um recurso no NetBeans para a criação de um CRUD com páginas JSF baseado em entidades JPA, no caso a classe Employee que acabamos de criar. Acesse o menu Arquivo | Novo Arquivo, na pasta
      categoria Persistence selecione "Páginas JSF de classes de entidade" e clique em próximo. Adicione a única classe persistente (Employee) existente (ver &lt;span style="font-weight: bold;"&gt;figura 1&lt;/span&gt;), clique em Próximo e a seguir clique em Finalizar.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_6CJaDmsVepU/SM6UVpf7LVI/AAAAAAAAAS0/btxOAqmjLKo/s1600-h/NetBeans-CRUD_JSF.jpg"&gt;&lt;img
      src="http://2.bp.blogspot.com/_6CJaDmsVepU/SM6UVpf7LVI/AAAAAAAAAS0/btxOAqmjLKo/s320/NetBeans-CRUD_JSF.jpg" alt="" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" id="BLOGGER_PHOTO_ID_5246293715571125586" /&gt;&lt;/a&gt;Execute a aplicação pressionando o botão F6 e faça testes, perceba que o NetBeans criou uma aplicação completa "a lá Ruby on Rails" com apenas alguns cliques.&lt;br /&gt;&lt;blockquote&gt; &lt;span style="font-family: courier
      new;"&gt;public class EmployeeController {&lt;br /&gt; &#160;&#160;private Employee employee = null;&lt;br /&gt; &#160;&#160;private List employees = null;&lt;br /&gt; &#160;&#160;@Resource&lt;br /&gt; &#160;&#160;private UserTransaction utx = null;&lt;br /&gt; &#160;&#160;@PersistenceUnit(unitName = "DEMO_EJB31PU")&lt;br /&gt; &#160;&#160;private EntityManagerFactory emf = null;&lt;br /&gt;&lt;br /&gt; &#160;&#160;public EntityManager getEntityManager() {&lt;br /&gt; &#160;&#160;&#160;&#160;return
      emf.createEntityManager();&lt;br /&gt; &#160;&#160;}&lt;br /&gt; &#160;&#160;public int batchSize = 5;&lt;br /&gt; &#160;&#160;private int firstItem = 0;&lt;br /&gt; &#160;&#160;private int itemCount = -1;&lt;br /&gt;&lt;br /&gt; &#160;&#160;public SelectItem[] getEmployeesAvailableSelectMany() {&lt;br /&gt; &#160;&#160;&#160;&#160;return getEmployeesAvailable(false);&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public SelectItem[] getEmployeesAvailableSelectOne() {&lt;br /&gt;
      &#160;&#160;&#160;&#160;return getEmployeesAvailable(true);&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;private SelectItem[] getEmployeesAvailable(boolean one) {&lt;br /&gt; &#160;&#160;&#160;&#160;List allEmployees = getEmployees(true);&lt;br /&gt; &#160;&#160;&#160;&#160;int size = one ? allEmployees.size() + 1 : allEmployees.size();&lt;br /&gt; &#160;&#160;&#160;&#160;SelectItem[] items = new SelectItem[size];&lt;br /&gt; &#160;&#160;&#160;&#160;int i = 0;&lt;br /&gt;
      &#160;&#160;&#160;&#160;if (one) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;items[0] = new SelectItem("", "---");&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;i++;&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;for (Employee x : allEmployees) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;items[i++] = new SelectItem(x, x.toString());&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;return items;&lt;br /&gt;
      &#160;&#160;&#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public Employee getEmployee() {&lt;br /&gt; &#160;&#160;&#160;&#160;if (employee == null) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;employee = getEmployeeFromRequest();&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;if (employee == null) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;employee = new Employee();&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;return
      employee;&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public String listSetup() {&lt;br /&gt; &#160;&#160;&#160;&#160;reset(true);&lt;br /&gt; &#160;&#160;&#160;&#160;return "employee_list";&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public String createSetup() {&lt;br /&gt; &#160;&#160;&#160;&#160;reset(false);&lt;br /&gt; &#160;&#160;&#160;&#160;employee = new Employee();&lt;br /&gt; &#160;&#160;&#160;&#160;return "employee_create";&lt;br /&gt;
      &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public String create() {&lt;br /&gt; &#160;&#160;&#160;&#160;EntityManager em = getEntityManager();&lt;br /&gt; &#160;&#160;&#160;&#160;try {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;utx.begin();&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;em.persist(employee);&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;utx.commit();&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;addSuccessMessage("Employee was successfully created.");&lt;br /&gt;
      &#160;&#160;&#160;&#160;} catch (Exception ex) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;try {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (findEmployee(employee.getId()) != null) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;addErrorMessage("Employee " + employee + " already exists.");&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;} else {&lt;br /&gt;
      &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ensureAddErrorMessage(ex, "A persistence error occurred.");&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;utx.rollback();&lt;br /&gt; &#160;&#160;&#160;&#160;} catch (Exception e) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;ensureAddErrorMessage(e, "An error occurred attempting to roll back the transaction.");&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt;
      &#160;&#160;&#160;&#160;return null;&lt;br /&gt; &#160;&#160;&#160;&#160;} finally {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;em.close();&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;return listSetup();&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public String detailSetup() {&lt;br /&gt; &#160;&#160;&#160;&#160;return scalarSetup("employee_detail");&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public String editSetup() {&lt;br
      /&gt; &#160;&#160;&#160;&#160;return scalarSetup("employee_edit");&lt;br /&gt; &#160;&#160;}&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;..&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size: 78%;"&gt;&lt;span style="font-weight: bold;"&gt;Listagem 1 - &lt;/span&gt;Parte da Classe EmployeeController gerado pelo NetBeans&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Perceba que o NetBeans
      gerou o código de persistencia em uma classe controller, vamos melhorar um pouco isto, tirando o código de acesso aos dados e isolando isto em uma classe DAO, depois vamos transformar esta classe em um EJB sem interface,&lt;br /&gt;&lt;br /&gt;OBS&gt; Cuidado, o uso de um EJB DAO deve ser restrito, pois dependendo do seu uso, isso pode ser um Anti-Pattern&lt;br /&gt;&lt;br /&gt;Vamos criar uma nova classe Java acessando o menu Arquivo | Novo Arquivo. Nomeie a classe como EmployeeDAO no pacote
      br.com.mundojava.dao. Nesta classe vamos colocar todos os métodos de acesso ao banco utilizados na classe EmployeeController e inclui-los na classe recém criada. Veja parte do código na Listagem 18.&lt;br /&gt;&lt;br /&gt;Vamos criar uma nova classe Java acessando o menu Arquivo | Novo Arquivo. Nomeie a classe como EmployeeDAO no pacote br.com.mundojava.dao.&lt;br /&gt;Adicionalmente vamos criar uma classe para tratamento de Exceptions, crie uma classe e nomeie de DatabaseException, na classe DAO
      vamos encapsular os erros de acesso a banco nesta classe.&lt;br /&gt;&lt;br /&gt;Criada a classe DAO, vamos colocar todos os métodos de acesso ao banco utilizados na classe EmployeeController. Feito isto, transforme esta classe EmployeeDAO em um EJB colocando a anotação Stateless em cima da declaração da classe. Veja parte da classe criada na &lt;span style="font-weight: bold;"&gt;Listagem 2&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family: courier new;"&gt;
      @Stateless&lt;br /&gt;public class EmployeeDAO {&lt;br /&gt;&lt;br /&gt; &#160;&#160;public static final int PROCESSADO = 1;&lt;br /&gt; &#160;&#160;public static final int JA_EXISTE = 2;&lt;br /&gt; &#160;&#160;public static final int ERRO = 3;&lt;br /&gt;&lt;br /&gt; &#160;&#160;@PersistenceUnit(unitName = "DEMO_EJB31PU")&lt;br /&gt; &#160;&#160;private EntityManagerFactory emf;&lt;br /&gt;&lt;br /&gt; &#160;&#160;private EntityManager getEntityManager() {&lt;br /&gt; &#160;&#160;&#160;&#160;return
      emf.createEntityManager();&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public Employee getEmployeeFromRequestParam(Object employee) {&lt;br /&gt; &#160;&#160;&#160;&#160;EntityManager em = getEntityManager();&lt;br /&gt; &#160;&#160;&#160;&#160;try{&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;Employee o = em.merge((Employee) employee);&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;return o;&lt;br /&gt; &#160;&#160;&#160;&#160;} finally {&lt;br /&gt;
      &#160;&#160;&#160;&#160;&#160;&#160;em.close();&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;}&lt;br /&gt; &lt;br /&gt; &#160;&#160;public int create(Employee employee) throws DatabaseException{&lt;br /&gt; &#160;&#160;EntityManager em = getEntityManager();&lt;br /&gt; &#160;&#160;&#160;&#160;try {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;em.getTransaction().begin();&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;em.persist(employee);&lt;br /&gt;
      &#160;&#160;&#160;&#160;&#160;&#160;em.getTransaction().commit();&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;return EmployeeDAO.PROCESSADO;&lt;br /&gt; &#160;&#160;&#160;&#160;} catch (Exception ex) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;try{&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;int opt = 0;&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (getEmployee(employee.getId()) != null) {&lt;br /&gt;
      &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;opt = EmployeeDAO.JA_EXISTE;&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;} else {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;opt = EmployeeDAO.ERRO;&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;throw new DatabaseException("A persistence error occurred.");&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&lt;br /&gt;
      &#160;&#160;&#160;&#160;&#160;&#160;em.getTransaction().rollback();&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;return opt;&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;}catch(Exception sup){&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;throw new DatabaseException("An error occurred attempting to roll back the transaction.");&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;} finally {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;em.close();&lt;br /&gt;
      &#160;&#160;&#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public void edit(Employee employee) throws DatabaseException {&lt;br /&gt; &#160;&#160;&#160;&#160;EntityManager em = getEntityManager();&lt;br /&gt; &#160;&#160;&#160;&#160;try {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;em.getTransaction().begin();&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;em.merge(employee);&lt;br /&gt;
      &#160;&#160;&#160;&#160;&#160;&#160;em.getTransaction().commit();&lt;br /&gt; &#160;&#160;&#160;&#160;} catch (Exception ex) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;try {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;em.getTransaction().rollback();&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;throw new DatabaseException(ex.getLocalizedMessage());&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;} catch (Exception e) {&lt;br /&gt;
      &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;throw new DatabaseException("An error occurred attempting to roll back the transaction.");&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;} finally {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;em.close();&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;}&lt;br /&gt; ...&lt;br /&gt; }&lt;/span&gt;&lt;/blockquote&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size: 78%;"&gt;&lt;span
      style="font-weight: bold;"&gt;Listagem 2&lt;/span&gt; - Parte da classe EmployeeDAO recém criada.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Fica um desafio para o leitor do blog, criar os métodos&lt;br /&gt;&lt;blockquote style="font-family: courier new;"&gt;public void destroy(Employee employee);&lt;br /&gt;public List getEmployees(boolean all,&lt;br /&gt; int batchSize,&lt;br /&gt; int firstItem);&lt;br /&gt;public List getEmployees(boolean all,&lt;br /&gt; int batchSize,&lt;br /&gt; int
      firstItem);&lt;br /&gt;public Employee getEmployee(Integer id);&lt;br /&gt;public int getItemCount();&lt;/blockquote&gt;&lt;br /&gt;Por fim, na classe EmployeeController vamos fazer algumas alterações para consumir o EJB sem interface. Primeiro declare uma variável do tipo EmployeeDAO, e vamos injetar com a referência do EJB, e troque todas as referências ao código de acesso ao banco para apontar para o nosso EJB DAO, veja como ficou na classe EmployeeController na &lt;span style="font-weight:
      bold;"&gt;Listagem 3&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family: courier new;"&gt;public class EmployeeController {&lt;br /&gt; &#160;&#160;private Employee employee = null;&lt;br /&gt; &#160;&#160;private List employees = null;&lt;br /&gt; &#160;&#160;public int batchSize = 5;&lt;br /&gt; &#160;&#160;private int firstItem = 0;&lt;br /&gt; &#160;&#160;private int itemCount = -1;&lt;br /&gt; &lt;span style="font-weight:
      bold;"&gt;&#160;&#160;@EJB&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&#160;&#160;EmployeeDAO dao;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &#160;&#160;public SelectItem[] getEmployeesAvailableSelectMany() {&lt;br /&gt; &#160;&#160;&#160;&#160;return getEmployeesAvailable(false);&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public SelectItem[] getEmployeesAvailableSelectOne() {&lt;br /&gt; &#160;&#160;&#160;&#160;return getEmployeesAvailable(true);&lt;br /&gt;
      &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;private SelectItem[] getEmployeesAvailable(boolean one) {&lt;br /&gt; &#160;&#160;&#160;&#160;List allEmployees = getEmployees(true);&lt;br /&gt; &#160;&#160;&#160;&#160;int size = one ? allEmployees.size() + 1 : allEmployees.size();&lt;br /&gt; &#160;&#160;&#160;&#160;SelectItem[] items = new SelectItem[size];&lt;br /&gt; &#160;&#160;&#160;&#160;int i = 0;&lt;br /&gt; &#160;&#160;&#160;&#160;if (one) {&lt;br /&gt;
      &#160;&#160;&#160;&#160;&#160;&#160;items[0] = new SelectItem("", "---");&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;i++;&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;for (Employee x : allEmployees) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;items[i++] = new SelectItem(x, x.toString());&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;return items;&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public Employee
      getEmployee() {&lt;br /&gt; &#160;&#160;&#160;&#160;if (employee == null) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;employee = getEmployeeFromRequest();&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;if (employee == null) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;employee = new Employee();&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;return employee;&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public String
      listSetup() {&lt;br /&gt; &#160;&#160;&#160;&#160;reset(true);&lt;br /&gt; &#160;&#160;&#160;&#160;return "employee_list";&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public String createSetup() {&lt;br /&gt; &#160;&#160;&#160;&#160;reset(false);&lt;br /&gt; &#160;&#160;&#160;&#160;employee = new Employee();&lt;br /&gt; &#160;&#160;&#160;&#160;return "employee_create";&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public String create() {&lt;br /&gt;
      &#160;&#160;&#160;&#160;int resultado = dao.PROCESSADO;&lt;br /&gt; &#160;&#160;&#160;&#160;try {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;resultado = dao.create(employee);&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;if (resultado == dao.PROCESSADO) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;addSuccessMessage("Employee was successfully created.");&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;} else if (resultado == dao.JA_EXISTE) {&lt;br /&gt;
      &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;addErrorMessage("Employee " + employee + " already exists.");&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;} catch (Exception ex) {&lt;br /&gt; &#160;&#160;&#160;&#160;&#160;&#160;ensureAddErrorMessage(ex, ex.getLocalizedMessage());&lt;br /&gt; &#160;&#160;&#160;&#160;}&lt;br /&gt; &#160;&#160;&#160;&#160;return listSetup();&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public String detailSetup()
      {&lt;br /&gt; &#160;&#160;&#160;&#160;return scalarSetup("employee_detail");&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;public String editSetup() {&lt;br /&gt; &#160;&#160;&#160;&#160;return scalarSetup("employee_edit");&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt; &#160;&#160;private String scalarSetup(String destination) {&lt;br /&gt; &#160;&#160;&#160;&#160;reset(false);&lt;br /&gt; &#160;&#160;&#160;&#160;employee = getEmployeeFromRequest();&lt;br /&gt;
      &#160;&#160;&#160;&#160;if (employee == null) {&lt;br /&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;String requestEmployeeString = getRequestParameter("jsfcrud.currentEmployee");&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span
      style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;addErrorMessage("The employee with id " + requestEmployeeString + " no longer exists.");&lt;br /&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;String relatedControllerOutcome = relatedControllerOutcome();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:
      courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;if (relatedControllerOutcome != null) {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;return relatedControllerOutcome;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span
      style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;return listSetup();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;}&lt;br /&gt; &#160;&#160;&#160;&#160;return destination;&lt;br /&gt; &#160;&#160;}&lt;br /&gt;&lt;br /&gt;
      &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;public String edit() {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;EmployeeConverter converter = new EmployeeConverter();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;
      &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;String employeeString = converter.getAsString(FacesContext.getCurrentInstance(), null, employee);&lt;br /&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;String currentEmployeeString =
      getRequestParameter("jsfcrud.currentEmployee");&lt;br /&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;if (employeeString == null || employeeString.length() == 0 || !employeeString.equals(currentEmployeeString)) {&lt;br /&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;
      &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;String outcome = editSetup();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if
      ("employee_edit".equals(outcome)) {&lt;br /&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;addErrorMessage("Could not edit employee. Try again.");&lt;br /&gt; &lt;/span&gt;&lt;span
      style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;return
      outcome;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;try {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span
      style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;dao.edit(employee);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;addSuccessMessage("Employee was successfully updated.");&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier
      new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;} catch (DatabaseException ex) {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;String msg = ex.getLocalizedMessage();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;
      &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (msg != null &amp;amp;&amp;amp; msg.length() &gt; 0) {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier
      new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;addErrorMessage(msg);&lt;br /&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}else if (getEmployeeFromRequest() == null) {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier
      new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;addErrorMessage("The employee with id " + &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;currentEmployeeString + " no longer exists.");&lt;br /&gt;&lt;/span&gt;&lt;span
      style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return listSetup();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span
      style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;} else {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;addErrorMessage("A persistence error occurred.");&lt;br /&gt; &lt;/span&gt;&lt;span
      style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier
      new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return null;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;return detailSetup();&lt;br /&gt;
      &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;public String destroy() {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier
      new;"&gt;&#160;&#160;&#160;&#160;employee = getEmployeeFromRequest();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;if (employee == null) {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;
      &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;String currentEmployeeString = getRequestParameter("jsfcrud.currentEmployee");&lt;br /&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;addErrorMessage("The employee with id " +
      currentEmployeeString + " no longer exists.");&lt;br /&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;String relatedControllerOutcome = relatedControllerOutcome();&lt;br /&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span
      style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;if (relatedControllerOutcome != null) {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span
      style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return relatedControllerOutcome;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;
      &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;return listSetup();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:
      courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;try {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;dao.destroy(employee);&lt;br
      /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;addSuccessMessage("Employee was successfully deleted.");&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span
      style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;} catch (DatabaseException ex) {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;ensureAddErrorMessage(ex, ex.getLocalizedMessage());&lt;br /&gt;
      &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;return null;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier
      new;"&gt;&#160;&#160;&#160;&#160;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;String relatedControllerOutcome = relatedControllerOutcome();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span
      style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;if (relatedControllerOutcome != null) {&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;&#160;&#160;return relatedControllerOutcome;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;
      &lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;&#160;&#160;return listSetup();&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt; &lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&#160;&#160;}&lt;br /&gt;...&lt;br /&gt;}&lt;br
      /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold; font-size: 78%;"&gt;Listagem 3&lt;/span&gt;&lt;span style="font-size: 78%;"&gt; - Classe EmployeeController refatorada para utilizar o EJB DAO sem interface&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Perceba que na expressão "@EJB EmployeeDAO dao" estamos referenciando ao EJB, sem interface para atrapalhar, claro que não é possível criar uma instância utilizando a palavra reservada &lt;span style="font-family: courier
      new;"&gt;new&lt;/span&gt; ainda, na verdade estamos trabalhando com um proxy, mas se quisermos podemos fazer um lookup utilizando JNDI também.&lt;br /&gt;Vou deixar o restante dos métodos para o leitor resolver, é apenas trocar a referencia pela classe dao conforme os métodos acima.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_6CJaDmsVepU/SM6lmKJmaUI/AAAAAAAAAS8/MYcHF1Hx_yI/s1600-h/Exemplo-App.jpg"&gt;&lt;img
      src="http://3.bp.blogspot.com/_6CJaDmsVepU/SM6lmKJmaUI/AAAAAAAAAS8/MYcHF1Hx_yI/s320/Exemplo-App.jpg" alt="" style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" border="0" id="BLOGGER_PHOTO_ID_5246312690911439170" /&gt;&lt;/a&gt;&lt;br /&gt;Compile e faça o deploy, rode a aplicação, se tudo deu certo você irá ver a sua aplicação rodando (ver figura 2) com um EJB sem interface, e o melhor, o EJB está dentro de um arquivo .war, já estamos implementando o empacotamento simplificado.&lt;br
      /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Veja como ficou o empacotamento do nosso projeto na &lt;span style="font-weight: bold;"&gt;Figura 3&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_6CJaDmsVepU/SM6mcEcvL6I/AAAAAAAAATE/JBJeHJ0ploU/s1600-h/Figura+6.jpg"&gt;&lt;img src="http://4.bp.blogspot.com/_6CJaDmsVepU/SM6mcEcvL6I/AAAAAAAAATE/JBJeHJ0ploU/s320/Figura+6.jpg" alt="" style="margin: 0px auto 10px; display: block; text-align: center;
      cursor: pointer;" border="0" id="BLOGGER_PHOTO_ID_5246313617094029218" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Para maiores informações sobre o futuro do Java Corporativo, leia a edição 31 da Mundo Java, que ainda traz ótimos artigos como:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="postbody"&gt;EJB 3.1:Conheça as Novidades do Futuro do Java Corporativo.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span
      class="postbody"&gt;&lt;span style="font-weight: bold;"&gt;Autor&lt;/span&gt;:Wagner Roberto dos Santos &lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt;Grizzly e Comet - Ajax Reverso com Escalabilidade. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; &lt;span style="font-weight: bold;"&gt;Autor&lt;/span&gt;: Pedro Cavalero &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Usando o Mavem para melhorar a Qualidade dos seus Projetos.
      &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; &lt;span style="font-weight: bold;"&gt;Autor&lt;/span&gt;:Márcio Varchavsky &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Criando Software mais próximo do Cliente com Domain-Drivgen Design. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; &lt;span style="font-weight: bold;"&gt;Autor&lt;/span&gt;:Sérgio Lopes &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Setembro: Mês de Java.
      &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; &lt;span style="font-weight: bold;"&gt;Autor&lt;/span&gt;:Mauricio Leal &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Testes de unidades Avançadas com JMock 2 &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; &lt;span style="font-weight: bold;"&gt;Autor&lt;/span&gt;:Eduardo Guerra &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Gerenciamento de Conteúdo Web com OpemCMS -Customização de
      Sites. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; &lt;span style="font-weight: bold;"&gt;Autor&lt;/span&gt;:Rodrigo Cunha de Paiva &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Tirando o Máximo dos Interceptors no Struts2. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt;&lt;span style="font-weight: bold;"&gt;Autor&lt;/span&gt;:&lt;/span&gt;&lt;span class="postbody"&gt; José Yoshiriro Ajisaka Ramos &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span
      class="postbody"&gt; Tendências em Foco:Ganhando com Open Source &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; &lt;span style="font-weight: bold;"&gt;Autor&lt;/span&gt;:Cezar Taurion &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Jogo Rápido &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; &lt;span style="font-weight: bold;"&gt;Autor&lt;/span&gt;:Charbel Symanski e Rodrigo Barbosa Cesar &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt;
      Mundo OO: Requisitos Executáveis com FIT &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; &lt;span style="font-weight: bold;"&gt;Autor&lt;/span&gt;:Rodrigo Yoshima &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; SOA na Pratica:Iniciando Projetos SOA. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; &lt;span style="font-weight: bold;"&gt;Autor&lt;/span&gt;:Ricardo Ferreira &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;span
      class="postbody"&gt; &lt;/span&gt;&lt;br /&gt;Diversão Garantida !!!</description>
      <pubDate>Tue, 16 Sep 2008 19:25:02 +0000</pubDate>
    </item>
    <item>
      <title>NetFeijão Brazil: NetBeans Platform na Mundo Java nº 29</title>
      <guid isPermaLink="false">tag:blogger.com,1999:blog-544668644670311424.post-1092719613194854803</guid>
      <link>http://netfeijao.blogspot.com/2008/05/netbeans-platform-na-mundo-java-n-29.html</link>
      <description>&lt;a href="http://bp2.blogger.com/_6CJaDmsVepU/SDOQ2D_B_lI/AAAAAAAAAPc/Bm_sGUa9_PU/s1600-h/mj29.jpg"&gt;&lt;img src="http://bp2.blogger.com/_6CJaDmsVepU/SDOQ2D_B_lI/AAAAAAAAAPc/Bm_sGUa9_PU/s400/mj29.jpg" alt="" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" id="BLOGGER_PHOTO_ID_5202661253000068690" /&gt;&lt;/a&gt;&lt;br /&gt;Este mês saiu nas bancas a revista Mundo Java nº29, um artigo meu sobre a plataforma NetBeans, expliquei as
      principais classes e funcionalidades, e no final apresentei um tutorial prático de como extender o NetBeans e criar poderosos plugins..&lt;br /&gt;Ainda nesta edição na seção "Eu uso" teve a participação mais que especial do Tim Boudreau, um dos engenheiros e pioneiro na criação das primeiras versões do IDE e do nosso querido Bruno Souza o JavaMan..&lt;br /&gt;Eu mesmo traduzi o artigo do Tim, espero que quem leu tenha gostado.&lt;br /&gt;Com a autorização do Tim, vou publicar o artigo dele na seção
      "Eu uso", claro, em inglês !!!&lt;br /&gt;&lt;blockquote&gt;I work on the NetBeans Platform. Probably the most gratifying thing about that work is to see how it is used - anybody who creates software wants to see it used - it is what gives our work meaning. In the simplest view, what the NetBeans Platform does is solve problems. I believe in writing software that can be finished. That is, you write something that is solid and right and works and then you can leave it alone and move on to the next
      problem. The modular nature of NetBeans - indeed, the module system itself - makes it easier to build software out of a lot of libraries each of which does one thing well - and guarantee system integrity at runtime. It solves the DLL hell problem for once and for all, and in the process creates design patterns that are ideal for distributed development - how do you build software created by a large community and minimize the risks that changes to one part of the system will break another? The core
      beauty of NetBeans is the module system.&lt;br /&gt;&lt;br /&gt;But what amazes me more is what people do on top of it. Let's take one case-in-point: Nokia. If you are a mobile service provider, such as Tim in Brazil (no relation :-)), and you buy your hardware from Nokia (your transmitters, the things that make a mobile phone network work), you will need some software to manage that network. If you are buying that hardware from Nokia, you get an application for managing your network. But it's not
      just one applications - it is many applications and one at the same time. They have used the NetBeans Platform plus Java WebStart technology together in an incredibly innovative way - and because Nokia contributed WebStart support to NetBeans, you can do the same thing for your applications.&lt;br /&gt;&lt;br /&gt;Java WebStart is a technology that lets you launch a Java desktop application by clicking a URL. Anybody who has installed Sun's Java has Java WebStart. It's not wildly popular yet, but it
      is an incredible technology for improving the experience people have with internet-based applications. Why? Because there is only one copy of the software. I once visited a company - actually a software development organization for a state in the U.S. They asked us: "Can you please release new versions less often? Every time you have a new version, some guy has to walk around with a CD-ROM and visit 350 workstations and install it!"&lt;br /&gt;&lt;br /&gt;That's crazy, and Java WebStart offers the
      solution. You click a URL and a desktop application starts - all the benefits of centralized management that you get from web applications, but it's a real desktop application. And when you download a new version, you don't download all the bits - only a diff between what was and what is. It's a darned cool technology.&lt;br /&gt;&lt;br /&gt;Now put that together with a modular system like NetBeans, where an application discovers its parts during startup.&lt;br /&gt;&lt;br /&gt;With Nokia's
      NetBeans-based software, it works like this: Imagine you work for a telecom in the mobile phone space. There are a lot of different jobs you might be doing: Some people monitor the network for problems. Some people dispatch physical repair trucks to go fix things. So, if you are using this software, well, you start it by clicking a link on the web. And to even see the link, you had to log in, so the system knows who you are and what you need.&lt;br /&gt;&lt;br /&gt;So what happens? You click the
      link. The server knows who you are and what your job is. The result is that you start up one application - but it is an application with many faces. The server gives you an application which contains those modules you need to do your job - it will be a different set of modules depending on what you do and what you need access to.&lt;br /&gt;&lt;br /&gt;Now think about what this does for the people who write this software! In a modular system, you usually do UI in one module and back-end logic in
      another. The result of all this is that the users have a better experience - they get a UI tailored for their job; and the developers get a better experience: 1. They can write back end logic once and share it for all possible cases, and 2. They don't have to write multiple applications that do variations on the same thing, and that saves a lot of time.&lt;br /&gt;&lt;br /&gt;Anybody who is doing a large-scale desktop application should consider the NetBeans Platform; anybody who is considering a
      suite of related programs that share some logic and diverge in UI would be insane not to consider using it.&lt;br /&gt;&lt;br /&gt;I am, of course, biased - I have worked on the NetBeans Platform. The criteria for people who could benefit from it are clear and hard to argue with:&lt;br /&gt;- Anybody doing a multi-window desktop application&lt;br /&gt;- Anybody writing a desktop application that needs to save state on shutdown&lt;br /&gt;- Anybody writing an application with a concept of selection
      that determines action enablement or similar&lt;br /&gt;- Particularly anybody writing several related applications that share some logic&lt;br /&gt;&lt;br /&gt;We've worked very hard to make it easy to try the NetBeans Platform for your application. If you fit, even remotely, into any of the categories above, you could save time, money and effort with it - give it a look.&lt;br /&gt;&lt;br /&gt;-Tim Boudreau, 16/12/07&lt;/blockquote&gt;&lt;br /&gt;Um agradecimento especial para o Bruno Souza por ter
      aceitado o convite, para o Tim Boudreau, para o Guapo e o Eduardo Guerra da Mundo Java que vem lutando para manter esta revista com um alto padrão, e claro para você leitor !!!&lt;br /&gt;&lt;br /&gt;Se você se interessa por aplicações desktop e tem interesse em saber como funciona a arquitetura por trás do IDE NetBeans, compre essa revista, além deste artigo você vai encontrar nesta edição os seguintes temas..&lt;br /&gt;&lt;a
      href="http://bp0.blogger.com/_6CJaDmsVepU/SDOREj_B_mI/AAAAAAAAAPk/lA2-AW8woEw/s1600-h/revistanumero0029.jpg"&gt;&lt;img src="http://bp0.blogger.com/_6CJaDmsVepU/SDOREj_B_mI/AAAAAAAAAPk/lA2-AW8woEw/s400/revistanumero0029.jpg" alt="" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" id="BLOGGER_PHOTO_ID_5202661502108171874" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="postbody"&gt; Desenvolvendo aplicações desktop ricas na Plataforma
      NetBeans. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Animações 2D em JavaFX na prática. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Binding, Componentes, Customizados e Template de Telas no SwingBeans 1.2. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Click Framework. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Acesso a Serviços Multimídia em Java ME com SIP-API e IMS. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span
      class="postbody"&gt; Tendências em foco: Java e o Mundo Web. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; RSS dinâmico, rápido e fácil com ROME e STRUTS 2 &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Escolhendo uma ferramenta Case Gratuita para modelagem UML. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Modelando Transações de Facade a AspectJ. &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; De olho no mercado: Educação
      continuada de um Desenvolvedor &lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="postbody"&gt; Mundo OO: O Ciclo Ágil de um Dia &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class="postbody"&gt; E mais , você leva de graça um Poster Mundo Java: Resumão SCJP- Parte III&lt;br /&gt;&lt;br /&gt;Diversão Garantida !!!&lt;br /&gt;&lt;/span&gt;</description>
      <pubDate>Mon, 15 Sep 2008 18:43:42 +0000</pubDate>
    </item>
    <item>
      <title>NetFeijão Brazil: Lançado a versão final do NetBeans 6.0</title>
      <guid isPermaLink="false">tag:blogger.com,1999:blog-544668644670311424.post-5625929637002105604</guid>
      <link>http://netfeijao.blogspot.com/2007/12/lanado-verso-final-do-netbeans-60.html</link>
      <description>Com quase um mês de atraso foi lançado oficialmente no dia 03/12/2007 a versão final do NetBeans 6.0, com várias melhorias, para aqueles que serem falaram mal do editor e da performance um recado.. Seus problemas acabaram !!&lt;br /&gt;As mudanças mais significativas foram no editor de texto do IDE, onde podemos destacar.&lt;br /&gt;* Code Completion Inteligente&lt;br /&gt;* Coloração Semântica&lt;br /&gt;* Refactoração Instantânea&lt;br /&gt;* Preview com antes - depois de
      alteração&lt;br /&gt;* Geração de código como sobrescrita de construtores, equals e hashCode&lt;br /&gt;* Suporte a várias linguagens como Java, Ruby, C/C++, XML, HTML, RHTML, JavaScript, e JSP.&lt;br /&gt;&lt;br /&gt;São muitas as novidades no novo IDE, não teria como destacar todas as novas funcs neste post, proponho a você desenvolvedor efetuar o download no site &lt;a href="http://netbeans.org/"&gt;netbeans.org&lt;/a&gt;, que agora vem disponível em várias opções de download (figura
      abaixo).&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp1.blogger.com/_6CJaDmsVepU/R1V4skAgKMI/AAAAAAAAAD8/lCP-y5AqGrU/s1600-h/nb1.JPG"&gt;&lt;img src="http://bp1.blogger.com/_6CJaDmsVepU/R1V4skAgKMI/AAAAAAAAAD8/lCP-y5AqGrU/s400/nb1.JPG" alt="" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" id="BLOGGER_PHOTO_ID_5140147256688650434" /&gt;&lt;/a&gt;&lt;br /&gt;e explore os tutoriais disponiveis no próprio site em &lt;span style="text-decoration:
      underline;"&gt;tutoriais.&lt;/span&gt;&lt;a href="http://www.netbeans.org/kb/"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Ainda falando de NetBeans 6, a última edição da revista mundo java nº 26, foi publicada um artigo meu sobre as novas funcionalidades do NetBeans 6 com enfânse nas mudanças do editor e no desenvolvimento de aplicações Swing com as JSRs 295 e 296 (Beans Binding e Swing Application Framework) a revista ainda possui diversas máterias interessantes com foco em SOA.. sem dúvida uma ótima
      pedida..&lt;br /&gt;&lt;br /&gt;&lt;a href="http://bp0.blogger.com/_6CJaDmsVepU/R1V96UAgKNI/AAAAAAAAAEE/gO3ifmiRDBk/s1600-h/revistanumero0026.jpg"&gt;&lt;img src="http://bp0.blogger.com/_6CJaDmsVepU/R1V96UAgKNI/AAAAAAAAAEE/gO3ifmiRDBk/s400/revistanumero0026.jpg" alt="" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" id="BLOGGER_PHOTO_ID_5140152990469990610" /&gt;&lt;/a&gt;</description>
      <pubDate>Mon, 15 Sep 2008 18:42:51 +0000</pubDate>
    </item>
    <item>
      <title>NetFeijão Brazil: EJB 3.1 no GlassFish V3 no NetBeans</title>
      <guid isPermaLink="false">tag:blogger.com,1999:blog-544668644670311424.post-8123168843860236823</guid>
      <link>http://netfeijao.blogspot.com/2008/09/ejb-31-no-glassfish-v3-no-netbeans.html</link>
      <description>Esta semana saiu nas bancas a&lt;span style="font-weight: bold;"&gt; edição 31&lt;/span&gt; da revista &lt;a href="http://www.mundojava.com.br/"&gt;Mundo Java&lt;/a&gt; com o título "&lt;span style="font-weight: bold;"&gt;Futuro do Java Corporativo"&lt;/span&gt;, com um artigo meu sobre o mesmo tema.&lt;br /&gt;Para quem quer saber o que vai rolar na próxima especificação do Java EE 6, está edição está um prato cheio, portanto compre uma edição e aproveite...&lt;br /&gt; Não vou entrar
      em muitos detalhes da matéria, mas vou descrever aqui melhor a demo que está na revista, onde apresento uma aplicação utilizando Session Bean da especificação de EJB 3.1 no GlassFish V3.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Instalando o GlassFish V3 e o conteiner EJB&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;No &lt;a href="https://glassfish.dev.java.net/downloads/v3-techPreview-1.html"&gt;site do GlassFish&lt;/a&gt; baixe o arquivo zip e descompacte em um diretório da sua escolha,
      a partir deste momento vamos chamar apenas de GLASSFISH_HOME\bin e execute o updatetool (Figura 1).&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_6CJaDmsVepU/SM25WJx368I/AAAAAAAAASs/QqzCCqlXUgY/s1600-h/glassfishV3.jpg"&gt;&lt;img src="http://3.bp.blogspot.com/_6CJaDmsVepU/SM25WJx368I/AAAAAAAAASs/QqzCCqlXUgY/s320/glassfishV3.jpg" alt="" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" id="BLOGGER_PHOTO_ID_5246052931189861314" /&gt;&lt;/a&gt; Na opção
      available addons, selecione glassfishv3-ejb e clique em Install, esta ação irá instalar o container EJB no Glassfish.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Instalando o plugin GlassFish V3 no NetBeans&lt;br /&gt;&lt;br /&gt;&lt;/span&gt; Agora inicie o NetBeans (de preferência a versão 6.1 ou 6.5) e instale o plugin do GlassFish V3 para o NetBeans em Ferramentas | Plugins, selecione em plugins disponíveis "Glassfish JavaEE Integration" e clique em instalar.&lt;br /&gt;Após
      instaldo o plugin, na aba Serviços, adicione um novo servidor, selecione a opção GlassFish V3 e siga os passos apontando o diretório GLASSFISH_HOME de instalação e finalizar.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Vamos explorar agora uma funcionalidade no NetBeans para a criação de CRUD, crie uma nova Aplicação Web na categoria Web e clique em Próximo.&lt;br /&gt;Neste passo digite "DEMO_EJB31" e clique em Próximo, na opção servidores selecione o servidor GlassFish V3 T2 recém instalado e
      clique em Próximo. No último passo selecione o framework JavaServer Faces e clique em Finalizar.&lt;br /&gt;&lt;br /&gt;Agora vamos criar uma aplicação CRUD completa baseada em uma entidade de banco de dados, para isso clique em Arquivo | Novo Arquivo, na categoria Persistence selecione a opção "Classes de entidade do banco de dados" e clique em Próximo.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;OBS:&lt;/span&gt; Antes de fazer o passo abaixo, inicie o banco de dados Derby na guia Serviços do
      NetBeans, clique com o botão direito do mouse em Java DB e clique em "Iniciar Servidor".&lt;br /&gt;&lt;br /&gt;Neste segundo passo, na lista Fonte de Dados selecione a opção "Nova Fonte de Dados", no campo "Nome JNDI" digite jndi/TesteEJB e na lista "Conexão de banco de dados" selecione o banco "jdbc:derby://localhost:1527/vir" já existente e clique em OK.&lt;br /&gt;&lt;br /&gt;Se tudo ocorreu de maneira correta será apresentada uma lista de tabelas disponíveis. Selecione a tabela Employee, clique
      em Adicionar e em seguida clique em Próximo.&lt;br /&gt;&lt;br /&gt;No campo nome do pacote digite br.com.netfeijao.entities e por fim clique no botão "Criar unidade de persistência". Mantenha os valores default clique em Criar e depois clique em Finalizar. Esta ação irá criar a classe persistente Employee no pacote informado.&lt;br /&gt;&lt;br /&gt;Agora vamos utilizar um recurso no NetBeans para a criação de um CRUD com páginas JSF baseado em entidades JPA, no caso a classe Employee que acabamos de
      criar. Acesse o menu Arquivo | Novo Arquivo, na pasta categoria Persistence selecione "Páginas JSF de classes de entidade" e clique em próximo. Adicione a única classe persistente (Employee) existente (ver &lt;span style="font-weight: bold;"&gt;figura 1&lt;/span&gt;), clique em Próximo e a seguir clique em Finalizar.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_6CJaDmsVepU/SM6UVpf7LVI/AAAAAAAAAS0/btxOAqmjLKo/s1600-h/NetBeans-CRUD_JSF.jpg"&gt;&lt;img
      src="http://2.bp.blogspot.com/_6CJaDmsVepU/SM6UVpf7LVI/AAAAAAAAAS0/btxOAqmjLKo/s320/NetBeans-CRUD_JSF.jpg" alt="" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" id="BLOGGER_PHOTO_ID_5246293715571125586" /&gt;&lt;/a&gt;Execute a aplicação pressionando o botão F6 e faça testes, perceba que o NetBeans criou uma aplicação completa "a lá Ruby on Rails" com apenas alguns cliques.&lt;br /&gt;&lt;blockquote&gt; &lt;span style="font-family: courier
      new;"&gt;public class EmployeeController {&lt;br /&gt; private Employee employee = null;&lt;br /&gt; private List employees = null;&lt;br /&gt; @Resource&lt;br /&gt; private UserTransaction utx = null;&lt;br /&gt; @PersistenceUnit(unitName = "DEMO_EJB31PU")&lt;br /&gt; private EntityManagerFactory emf = null;&lt;br /&gt;&lt;br /&gt; public EntityManager getEntityManager() {&lt;br /&gt; return emf.createEntityManager();&lt;br /&gt; }&lt;br /&gt; public int batchSize = 5;&lt;br /&gt; private int
      firstItem = 0;&lt;br /&gt; private int itemCount = -1;&lt;br /&gt;&lt;br /&gt; public SelectItem[] getEmployeesAvailableSelectMany() {&lt;br /&gt; return getEmployeesAvailable(false);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public SelectItem[] getEmployeesAvailableSelectOne() {&lt;br /&gt; return getEmployeesAvailable(true);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private SelectItem[] getEmployeesAvailable(boolean one) {&lt;br /&gt; List allEmployees = getEmployees(true);&lt;br /&gt; int size = one ?
      allEmployees.size() + 1 : allEmployees.size();&lt;br /&gt; SelectItem[] items = new SelectItem[size];&lt;br /&gt; int i = 0;&lt;br /&gt; if (one) {&lt;br /&gt; items[0] = new SelectItem("", "---");&lt;br /&gt; i++;&lt;br /&gt; }&lt;br /&gt; for (Employee x : allEmployees) {&lt;br /&gt; items[i++] = new SelectItem(x, x.toString());&lt;br /&gt; }&lt;br /&gt; return items;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public Employee getEmployee() {&lt;br /&gt; if (employee == null) {&lt;br /&gt; employee =
      getEmployeeFromRequest();&lt;br /&gt; }&lt;br /&gt; if (employee == null) {&lt;br /&gt; employee = new Employee();&lt;br /&gt; }&lt;br /&gt; return employee;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String listSetup() {&lt;br /&gt; reset(true);&lt;br /&gt; return "employee_list";&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String createSetup() {&lt;br /&gt; reset(false);&lt;br /&gt; employee = new Employee();&lt;br /&gt; return "employee_create";&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public
      String create() {&lt;br /&gt; EntityManager em = getEntityManager();&lt;br /&gt; try {&lt;br /&gt; utx.begin();&lt;br /&gt; em.persist(employee);&lt;br /&gt; utx.commit();&lt;br /&gt; addSuccessMessage("Employee was successfully created.");&lt;br /&gt; } catch (Exception ex) {&lt;br /&gt; try {&lt;br /&gt; if (findEmployee(employee.getId()) != null) {&lt;br /&gt; addErrorMessage("Employee " + employee + " already exists.");&lt;br /&gt; } else {&lt;br /&gt; ensureAddErrorMessage(ex, "A persistence
      error occurred.");&lt;br /&gt; }&lt;br /&gt; utx.rollback();&lt;br /&gt; } catch (Exception e) {&lt;br /&gt; ensureAddErrorMessage(e, "An error occurred attempting to roll back the transaction.");&lt;br /&gt; }&lt;br /&gt; return null;&lt;br /&gt; } finally {&lt;br /&gt; em.close();&lt;br /&gt; }&lt;br /&gt; return listSetup();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String detailSetup() {&lt;br /&gt; return scalarSetup("employee_detail");&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String
      editSetup() {&lt;br /&gt; return scalarSetup("employee_edit");&lt;br /&gt; }&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;..&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size: 78%;"&gt;&lt;span style="font-weight: bold;"&gt;Listagem 1 - &lt;/span&gt;Parte da Classe EmployeeController gerado pelo NetBeans&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br
      /&gt;Perceba que o NetBeans gerou o código de persistencia em uma classe controller, vamos melhorar um pouco isto, tirando o código de acesso aos dados e isolando isto em uma classe DAO, depois vamos transformar esta classe em um EJB sem interface,&lt;br /&gt;&lt;br /&gt;OBS&gt; Cuidado, o uso de um EJB DAO deve ser restrito, pois dependendo do seu uso, isso pode ser um Anti-Pattern&lt;br /&gt;&lt;br /&gt;Vamos criar uma nova classe Java acessando o menu Arquivo | Novo Arquivo. Nomeie a classe como
      EmployeeDAO no pacote br.com.mundojava.dao. Nesta classe vamos colocar todos os métodos de acesso ao banco utilizados na classe EmployeeController e inclui-los na classe recém criada. Veja parte do código na Listagem 18.&lt;br /&gt;&lt;br /&gt;Vamos criar uma nova classe Java acessando o menu Arquivo | Novo Arquivo. Nomeie a classe como EmployeeDAO no pacote br.com.mundojava.dao.&lt;br /&gt;Adicionalmente vamos criar uma classe para tratamento de Exceptions, crie uma classe e nomeie de
      DatabaseException, na classe DAO vamos encapsular os erros de acesso a banco nesta classe.&lt;br /&gt;&lt;br /&gt;Criada a classe DAO, vamos colocar todos os métodos de acesso ao banco utilizados na classe EmployeeController. Feito isto, transforme esta classe EmployeeDAO em um EJB colocando a anotação Stateless em cima da declaração da classe. Veja parte da classe criada na &lt;span style="font-weight: bold;"&gt;Listagem 2&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier
      new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family: courier new;"&gt; @Stateless&lt;br /&gt;public class EmployeeDAO {&lt;br /&gt;&lt;br /&gt; public static final int PROCESSADO = 1;&lt;br /&gt; public static final int JA_EXISTE = 2;&lt;br /&gt; public static final int ERRO = 3;&lt;br /&gt;&lt;br /&gt; @PersistenceUnit(unitName = "DEMO_EJB31PU")&lt;br /&gt; private EntityManagerFactory emf;&lt;br /&gt;&lt;br /&gt; private EntityManager getEntityManager() {&lt;br /&gt; return
      emf.createEntityManager();&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public Employee getEmployeeFromRequestParam(Object employee) {&lt;br /&gt; EntityManager em = getEntityManager();&lt;br /&gt; try{&lt;br /&gt; Employee o = em.merge((Employee) employee);&lt;br /&gt; return o;&lt;br /&gt; } finally {&lt;br /&gt; em.close();&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public int create(Employee employee) throws DatabaseException{&lt;br /&gt; EntityManager em = getEntityManager();&lt;br /&gt; try
      {&lt;br /&gt; em.getTransaction().begin();&lt;br /&gt; em.persist(employee);&lt;br /&gt; em.getTransaction().commit();&lt;br /&gt; return EmployeeDAO.PROCESSADO;&lt;br /&gt; } catch (Exception ex) {&lt;br /&gt; try{&lt;br /&gt; int opt = 0;&lt;br /&gt; if (getEmployee(employee.getId()) != null) {&lt;br /&gt; opt = EmployeeDAO.JA_EXISTE;&lt;br /&gt; } else {&lt;br /&gt; opt = EmployeeDAO.ERRO;&lt;br /&gt; throw new DatabaseException("A persistence error occurred.");&lt;br /&gt; }&lt;br /&gt;
      em.getTransaction().rollback();&lt;br /&gt; return opt;&lt;br /&gt; }catch(Exception sup){&lt;br /&gt; throw new DatabaseException("An error occurred attempting to roll back the transaction.");&lt;br /&gt; } finally {&lt;br /&gt; em.close();&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; &lt;br /&gt; public void edit(Employee employee) throws DatabaseException {&lt;br /&gt; EntityManager em = getEntityManager();&lt;br /&gt; try {&lt;br /&gt; em.getTransaction().begin();&lt;br /&gt;
      em.merge(employee);&lt;br /&gt; em.getTransaction().commit();&lt;br /&gt; } catch (Exception ex) {&lt;br /&gt; try {&lt;br /&gt; em.getTransaction().rollback();&lt;br /&gt; throw new DatabaseException(ex.getLocalizedMessage());&lt;br /&gt; } catch (Exception e) {&lt;br /&gt; throw new DatabaseException("An error occurred attempting to roll back the transaction.");&lt;br /&gt; }&lt;br /&gt; } finally {&lt;br /&gt; em.close();&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; ...&lt;br
      /&gt;}&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-size: 78%;"&gt;&lt;span style="font-weight: bold;"&gt;Listagem 2&lt;/span&gt; - Parte da classe EmployeeDAO recém criada.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Fica um desafio para o leitor do blog, criar os métodos&lt;br /&gt;&lt;blockquote style="font-family: courier
      new;"&gt;public void destroy(Employee employee);&lt;br /&gt;public List getEmployees(boolean all,&lt;br /&gt; int batchSize,&lt;br /&gt; int firstItem);&lt;br /&gt;public List getEmployees(boolean all,&lt;br /&gt; int batchSize,&lt;br /&gt; int firstItem);&lt;br /&gt;public Employee getEmployee(Integer id);&lt;br /&gt;public int getItemCount();&lt;/blockquote&gt;&lt;br /&gt;Por fim, na classe EmployeeController vamos fazer algumas alterações para consumir o EJB sem interface. Primeiro declare uma
      variável do tipo EmployeeDAO, e vamos injetar com a referência do EJB, e troque todas as referências ao código de acesso ao banco para apontar para o nosso EJB DAO, veja como ficou na classe EmployeeController na &lt;span style="font-weight: bold;"&gt;Listagem 3&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family: courier new;"&gt;public class EmployeeController {&lt;br /&gt;&lt;br /&gt; private Employee
      employee = null;&lt;br /&gt; private List employees = null;&lt;br /&gt; public int batchSize = 5;&lt;br /&gt; private int firstItem = 0;&lt;br /&gt; private int itemCount = -1;&lt;br /&gt; &lt;span style="font-weight: bold;"&gt;@EJB&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; EmployeeDAO dao;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; public SelectItem[] getEmployeesAvailableSelectMany() {&lt;br /&gt; return getEmployeesAvailable(false);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public
      SelectItem[] getEmployeesAvailableSelectOne() {&lt;br /&gt; return getEmployeesAvailable(true);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private SelectItem[] getEmployeesAvailable(boolean one) {&lt;br /&gt; List allEmployees = getEmployees(true);&lt;br /&gt; int size = one ? allEmployees.size() + 1 : allEmployees.size();&lt;br /&gt; SelectItem[] items = new SelectItem[size];&lt;br /&gt; int i = 0;&lt;br /&gt; if (one) {&lt;br /&gt; items[0] = new SelectItem("", "---");&lt;br /&gt; i++;&lt;br /&gt;
      }&lt;br /&gt; for (Employee x : allEmployees) {&lt;br /&gt; items[i++] = new SelectItem(x, x.toString());&lt;br /&gt; }&lt;br /&gt; return items;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public Employee getEmployee() {&lt;br /&gt; if (employee == null) {&lt;br /&gt; employee = getEmployeeFromRequest();&lt;br /&gt; }&lt;br /&gt; if (employee == null) {&lt;br /&gt; employee = new Employee();&lt;br /&gt; }&lt;br /&gt; return employee;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String listSetup() {&lt;br
      /&gt; reset(true);&lt;br /&gt; return "employee_list";&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String createSetup() {&lt;br /&gt; reset(false);&lt;br /&gt; employee = new Employee();&lt;br /&gt; return "employee_create";&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String create() {&lt;br /&gt; int resultado = dao.PROCESSADO;&lt;br /&gt; try {&lt;br /&gt; resultado = dao.create(employee);&lt;br /&gt; if (resultado == dao.PROCESSADO) {&lt;br /&gt; addSuccessMessage("Employee was successfully
      created.");&lt;br /&gt; } else if (resultado == dao.JA_EXISTE) {&lt;br /&gt; addErrorMessage("Employee " + employee + " already exists.");&lt;br /&gt; }&lt;br /&gt; } catch (Exception ex) {&lt;br /&gt; ensureAddErrorMessage(ex, ex.getLocalizedMessage());&lt;br /&gt; }&lt;br /&gt; return listSetup();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String detailSetup() {&lt;br /&gt; return scalarSetup("employee_detail");&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String editSetup() {&lt;br /&gt; return
      scalarSetup("employee_edit");&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private String scalarSetup(String destination) {&lt;br /&gt; reset(false);&lt;br /&gt; employee = getEmployeeFromRequest();&lt;br /&gt; if (employee == null) {&lt;br /&gt; String requestEmployeeString = getRequestParameter("jsfcrud.currentEmployee");&lt;br /&gt; addErrorMessage("The employee with id " + requestEmployeeString + " no longer exists.");&lt;br /&gt; String relatedControllerOutcome = relatedControllerOutcome();&lt;br /&gt;
      if (relatedControllerOutcome != null) {&lt;br /&gt; return relatedControllerOutcome;&lt;br /&gt; }&lt;br /&gt; return listSetup();&lt;br /&gt; }&lt;br /&gt; return destination;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String edit() {&lt;br /&gt; EmployeeConverter converter = new EmployeeConverter();&lt;br /&gt; String employeeString = converter.getAsString(FacesContext.getCurrentInstance(), null, employee);&lt;br /&gt; String currentEmployeeString =
      getRequestParameter("jsfcrud.currentEmployee");&lt;br /&gt; if (employeeString == null || employeeString.length() == 0 || !employeeString.equals(currentEmployeeString)) {&lt;br /&gt; String outcome = editSetup();&lt;br /&gt; if ("employee_edit".equals(outcome)) {&lt;br /&gt; addErrorMessage("Could not edit employee. Try again.");&lt;br /&gt; }&lt;br /&gt; return outcome;&lt;br /&gt; }&lt;br /&gt; try {&lt;br /&gt; dao.edit(employee);&lt;br /&gt; addSuccessMessage("Employee was successfully
      updated.");&lt;br /&gt; } catch (DatabaseException ex) {&lt;br /&gt; String msg = ex.getLocalizedMessage();&lt;br /&gt; if (msg != null &amp;amp;&amp;amp; msg.length() &gt; 0) {&lt;br /&gt; addErrorMessage(msg);&lt;br /&gt; } else if (getEmployeeFromRequest() == null) {&lt;br /&gt; addErrorMessage("The employee with id " + currentEmployeeString + " no longer exists.");&lt;br /&gt; return listSetup();&lt;br /&gt; } else {&lt;br /&gt; addErrorMessage("A persistence error occurred.");&lt;br /&gt;
      }&lt;br /&gt; return null;&lt;br /&gt; }&lt;br /&gt; return detailSetup();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public String destroy() {&lt;br /&gt; employee = getEmployeeFromRequest();&lt;br /&gt; if (employee == null) {&lt;br /&gt; String currentEmployeeString = getRequestParameter("jsfcrud.currentEmployee");&lt;br /&gt; addErrorMessage("The employee with id " + currentEmployeeString + " no longer exists.");&lt;br /&gt; String relatedControllerOutcome = relatedControllerOutcome();&lt;br /&gt; if
      (relatedControllerOutcome != null) {&lt;br /&gt; return relatedControllerOutcome;&lt;br /&gt; }&lt;br /&gt; return listSetup();&lt;br /&gt; }&lt;br /&gt; try {&lt;br /&gt; dao.destroy(employee);&lt;br /&gt; addSuccessMessage("Employee was successfully deleted.");&lt;br /&gt; } catch (DatabaseException ex) {&lt;br /&gt; ensureAddErrorMessage(ex, ex.getLocalizedMessage());&lt;br /&gt; return null;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; String relatedControllerOutcome = relatedControllerOutcome();&lt;br
      /&gt; if (relatedControllerOutcome != null) {&lt;br /&gt; return relatedControllerOutcome;&lt;br /&gt; }&lt;br /&gt; return listSetup();&lt;br /&gt; }&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family: courier new;"&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Listagem 3&lt;/span&gt; - Classe EmployeeController refatorada para utilizar o EJB DAO
      sem interface&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt; Perceba que na expressão "@EJB EmployeeDAO dao" estamos referenciando ao EJB, sem interface para atrapalhar, claro que não é possível criar uma instância utilizando a palavra reservada &lt;span style="font-family: courier new;"&gt;new&lt;/span&gt; ainda, na verdade estamos trabalhando com um proxy, mas se quisermos podemos fazer um lookup utilizando JNDI também.&lt;br /&gt;Vou deixar o restante dos métodos para o leitor
      resolver, é apenas trocar a referencia pela classe dao conforme os métodos acima.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_6CJaDmsVepU/SM6lmKJmaUI/AAAAAAAAAS8/MYcHF1Hx_yI/s1600-h/Exemplo-App.jpg"&gt;&lt;img src="http://3.bp.blogspot.com/_6CJaDmsVepU/SM6lmKJmaUI/AAAAAAAAAS8/MYcHF1Hx_yI/s320/Exemplo-App.jpg" alt="" style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" border="0" id="BLOGGER_PHOTO_ID_5246312690911439170" /&gt;&lt;/a&gt;&lt;br /&gt;Compile e faça o deploy,
      rode a aplicação, se tudo deu certo você irá ver a sua aplicação rodando (ver figura 2) com um EJB sem interface, e o melhor, o EJB está dentro de um arquivo .war, já estamos implementando o empacotamento simplificado.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Veja como ficou o empacotamento do nosso projeto na &lt;span style="font-weight: bold;"&gt;Figura 3&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a
      href="http://4.bp.blogspot.com/_6CJaDmsVepU/SM6mcEcvL6I/AAAAAAAAATE/JBJeHJ0ploU/s1600-h/Figura+6.jpg"&gt;&lt;img src="http://4.bp.blogspot.com/_6CJaDmsVepU/SM6mcEcvL6I/AAAAAAAAATE/JBJeHJ0ploU/s320/Figura+6.jpg" alt="" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" border="0" id="BLOGGER_PHOTO_ID_5246313617094029218" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt; Para maiores informações sobre o futuro do Java Corporativo, leia a edição 31 da Mundo Java, que ainda traz
      ótimos artigos como:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;div style="text-align: left;"&gt;&lt;span class="postbody"&gt;&lt;/span&gt;&lt;span class="postbody"&gt;* EJB 3.1:Conheça as Novidades do Futuro do Java Corporativo. &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; Autor:Wagner Roberto dos Santos &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; * Grizzly e Comet - Ajax Reverso com Escalabilidade. &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt;
      Autor: Pedro Cavalero &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; * Usando o Mavem para melhorar a Qualidade dos seus Projetos. &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; Autor:Márcio Varchavsky &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; * Criando Software mais próximo do Cliente com Domain-Drivgen Design. &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; Autor:Sérgio Lopes &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; * Setembro: Mês de Java.
      &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; Autor:Mauricio Leal &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; * Testes de unidades Avançadas com JMock 2 &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; Autor:Eduardo Guerra &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; * Gerenciamento de Conteúdo Web com OpemCMS -Customização de Sites. &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; Autor:Rodrigo Cunha de Paiva &lt;/span&gt;&lt;br /&gt;&lt;span
      class="postbody"&gt; * Tirando o Máximo dos Interceptors no Struts2. &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; &lt;/span&gt;&lt;span class="postbody"&gt;Autor:&lt;/span&gt;&lt;span class="postbody"&gt; José Yoshiriro Ajisaka Ramos &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; * Tendências em Foco:Ganhando com Open Source &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; Autor:Cezar Taurion &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; * Jogo Rápido
      &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; Autor:Charbel Symanski e Rodrigo Barbosa Cesar &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; * Mundo OO: Requisitos Executáveis com FIT &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; Autor:Rodrigo Yoshima &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; * SOA na Pratica:Iniciando Projetos SOA. &lt;/span&gt;&lt;br /&gt;&lt;span class="postbody"&gt; Autor:Ricardo Ferreira &lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span
      class="postbody"&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="postbody"&gt; &lt;/span&gt;&lt;br /&gt; Diversão Garantida !!!&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;</description>
      <pubDate>Mon, 15 Sep 2008 18:29:17 +0000</pubDate>
    </item>
    <item>
      <title>Silveira Neto » netbeans: Some Sun Student Datasheets</title>
      <guid isPermaLink="false">http://silveiraneto.net/?p=1268</guid>
      <link>http://silveiraneto.net/2008/09/10/some-sun-student-datasheets/</link>
      <description>&lt;p&gt;Some Sun student datasheet posters. Click on the images to download them.&lt;/p&gt; &lt;p&gt;&lt;a href="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish_student_datasheet.pdf"&gt;&lt;img src="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish.png" title="glassfish" height="104" width="82" alt="Glassfish Student Datasheet" class="size-full wp-image-1267" /&gt;&lt;/a&gt; &lt;a
      href="http://silveiraneto.net/wp-content/uploads/2008/09/lustre_student_datasheet.pdf"&gt;&lt;img src="http://silveiraneto.net/wp-content/uploads/2008/09/lustre.png" title="lustre" height="104" width="82" alt="Lustra Student Datasheet" class="size-full wp-image-1270" /&gt;&lt;/a&gt; &lt;a href="http://silveiraneto.net/wp-content/uploads/2008/09/mysql_student_datasheet.pdf" title="MySQL"&gt;&lt;img src="http://silveiraneto.net/wp-content/uploads/2008/09/mysql.png" title="mysql" height="105" width="82"
      alt="" class="alignnone size-full wp-image-1274" /&gt;&lt;/a&gt; &lt;a href="http://silveiraneto.net/wp-content/uploads/2008/09/netbeans_students_datasheet.pdf"&gt;&lt;img src="http://silveiraneto.net/wp-content/uploads/2008/09/netbeans.png" title="netbeans" height="105" width="82" alt="" class="alignnone size-full wp-image-1275" /&gt;&lt;/a&gt; &lt;a href="http://silveiraneto.net/wp-content/uploads/2008/09/opensolaris_students_datasheet.pdf"&gt;&lt;img
      src="http://silveiraneto.net/wp-content/uploads/2008/09/opensolaris.png" title="opensolaris" height="105" width="82" alt="" class="alignnone size-full wp-image-1276" /&gt;&lt;/a&gt; &lt;a href="http://silveiraneto.net/wp-content/uploads/2008/09/sun_student_datasheet.pdf"&gt;&lt;img src="http://silveiraneto.net/wp-content/uploads/2008/09/sun.png" title="sun" height="105" width="82" alt="" class="alignnone size-full wp-image-1277" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Or in those links.&lt;/p&gt;
      &lt;ul&gt; &lt;li&gt;&lt;a href="http://silveiraneto.net/wp-content/uploads/2008/09/glassfish_student_datasheet.pdf"&gt;glassfish_student_datasheet.pdf&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://silveiraneto.net/wp-content/uploads/2008/09/lustre_student_datasheet.pdf"&gt;lustre_student_datasheet.pdf&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://silveiraneto.net/wp-content/uploads/2008/09/mysql_student_datasheet.pdf"&gt;mysql_student_datasheet.pdf&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a
      href="http://silveiraneto.net/wp-content/uploads/2008/09/netbeans_students_datasheet.pdf"&gt;netbeans_students_datasheet.pdf&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://silveiraneto.net/wp-content/uploads/2008/09/opensolaris_student_datasheet.pdf"&gt;opensolaris_student_datasheet.pdf&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://silveiraneto.net/wp-content/uploads/2008/09/sun_student_datasheet.pdf"&gt;sun_student_datasheet.pdf&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;</description>
      <pubDate>Wed, 10 Sep 2008 21:02:25 +0000</pubDate>
    </item>
    <item>
      <title>Paulo Canedo » NetBeans English: Creating a CRUD with JSF and Ajax using NetBeans 6.5 Beta</title>
      <guid isPermaLink="false">http://localhost/wordpress/?p=32</guid>
      <link>http://www.paulocanedo.com.br/2008/09/05/creating-a-crud-with-jsf-and-ajax-using-netbeans-65-beta/</link>
      <description>&lt;p&gt;Pre-requisite: NetBeans 6.5 Beta, or most recent version with the “Java Web and EE” or “All” pack. The glassfish version 2 or 3 must be installed.&lt;/p&gt; &lt;p&gt;On this tutorial we will see how to create a CRUD application (Create, Read, Update and Delete) using the NetBeans IDE 6.5 Beta. The main features demonstred in this tutorial are: work with a web project using glassfish and Java Server Faces; create a Persistence Unit; create an Entity Class; automaticaly generate
      jsf pages from an Entity Class.&lt;/p&gt; &lt;p&gt;Let’s start, first of all go to the Services Tab (Ctrl+5), open Databases node and follow the steps bellow:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Click with right button in Java DB on Start Server (Picture 1)&lt;/li&gt; &lt;li&gt;Click again with right button in Java DB and now click on Create Database…&lt;/li&gt; &lt;li&gt;In the next window fill all fields according to Picture 2&lt;/li&gt; &lt;/ol&gt; &lt;div style="width: 301px;" class="wp-caption
      alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/news/images/nb65beta_start_javadb.gif" style="border: 0pt none;" title="Picture 1 - Starting Java DB server" height="399" width="291" alt="" border="0" /&gt;&lt;p class="wp-caption-text"&gt;Picture 1 - Starting Java DB server&lt;/p&gt;&lt;/div&gt; &lt;div style="width: 554px;" class="wp-caption alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/news/images/nb65beta_create_db.gif" style="border: 0pt none;" title="Picture 2 - Creating a new
      database in Java DB" height="206" width="544" alt="" border="0" /&gt;&lt;p class="wp-caption-text"&gt;Picture 2 - Creating a new database in Java DB&lt;/p&gt;&lt;/div&gt; &lt;p&gt;After the database creation, so let’s go to our NetBeans project:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Create a new web project (File-&gt;New project) in Java Web category, then choose the option Web Application (Picture 3)&lt;/li&gt; &lt;li&gt;in the next window fill all the fields according with Picture 4&lt;/li&gt;
      &lt;li&gt;Define the web server (recommended glassfish v2 or v3) and the context path (Picture 5)&lt;/li&gt; &lt;li&gt;Click next and select the framework: JavaServer Faces (Picture 6)&lt;/li&gt; &lt;/ol&gt; &lt;div style="width: 729px;" class="wp-caption alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/news/images/nb65beta_new_project_web.gif" style="border: 0pt none;" title="Picture 3 - Creating a new web project" height="468" width="719" alt="" border="0" /&gt;&lt;p
      class="wp-caption-text"&gt;Picture 3 - Creating a new web project&lt;/p&gt;&lt;/div&gt; &lt;div style="width: 731px;" class="wp-caption alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/news/images/nb65beta_name_and_location.gif" style="border: 0pt none;" title="Picture 4 - Defining project name and project local" height="470" width="721" alt="" border="0" /&gt;&lt;p class="wp-caption-text"&gt;Picture 4 - Defining project name and project local&lt;/p&gt;&lt;/div&gt; &lt;div style="width:
      731px;" class="wp-caption alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/news/images/nb65beta_server_and_settings.gif" style="border: 0pt none;" title="Picture 5 - Suggestions to choose the web server and your configurations" height="470" width="721" alt="" border="0" /&gt;&lt;p class="wp-caption-text"&gt;Picture 5 - Suggestions to choose the web server and your configurations&lt;/p&gt;&lt;/div&gt; &lt;div style="width: 701px;" class="wp-caption alignnone"&gt;&lt;img
      src="http://www.paulocanedo.com.br/news/images/nb65beta_frameworks.gif" style="border: 0pt none;" title="Picture 6 - Adding the framework Java Server Faces to your project" height="387" width="691" alt="" border="0" /&gt;&lt;p class="wp-caption-text"&gt;Picture 6 - Adding the framework Java Server Faces to your project&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Now your project is created, to test if your project is working correctly with the web server, click with rigth button in project tab (Ctrl+1) and click
      Run.&lt;br /&gt; Well, the next step is create a new Persistence Unit, an Entity Class, the JPA (Java Persistence API) controllers:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Click in File-&gt;New File, select the Persistence category, so choose the option Persistence Unit and click next&lt;/li&gt; &lt;li&gt;Click at the combobox arrow and select New Data Source …&lt;/li&gt; &lt;li&gt;Type a name to jndi (eg: dsExemploJsf or dsSampleJsf), at Database Connection select the connection with the database that you
      created in the begin of this tutorial, click ok&lt;/li&gt; &lt;li&gt;In Provider and Database window fill all fields according with Picture 8 and then click finish&lt;/li&gt; &lt;li&gt;Again click File-&gt;New File, in Persistence category, select Entity Class and click next&lt;/li&gt; &lt;li&gt;In the next window fill all fields according with Picture 9 and click finish&lt;/li&gt; &lt;/ol&gt; &lt;div style="width: 731px;" class="wp-caption alignnone"&gt;&lt;img
      src="http://www.paulocanedo.com.br/news/images/nb65beta_new_persistence_unit.gif" style="border: 0pt none;" title="Picture 7 - New Persistence Unit" height="470" width="721" alt="" border="0" /&gt;&lt;p class="wp-caption-text"&gt;Picture 7 - New Persistence Unit&lt;/p&gt;&lt;/div&gt; &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt; &lt;div style="width: 786px;" class="wp-caption alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/news/images/nb65beta_provider_and_database.gif" style="border: 0pt none;"
      title="Picture 8 - Provider and Database" height="470" width="776" alt="" border="0" /&gt;&lt;p class="wp-caption-text"&gt;Picture 8 - Provider and Database&lt;/p&gt;&lt;/div&gt; &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt; &lt;div style="width: 731px;" class="wp-caption alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/news/images/nb65beta_new_entity_class.gif" style="border: 0pt none;" title="Picture 9 - Creating a new Entity class" height="470" width="721" alt="" border="0" /&gt;&lt;p
      class="wp-caption-text"&gt;Picture 9 - Creating a new Entity class&lt;/p&gt;&lt;/div&gt; &lt;p&gt;After generating the Livro.java (or Book.java) NetBeans shold automatically open it, let’s edit this file that way:&lt;br /&gt; &lt;code&gt;&lt;br /&gt; @Id&lt;br /&gt; @GeneratedValue(strategy = GenerationType.AUTO)&lt;br /&gt; private Long id;&lt;br /&gt; &lt;strong&gt;&lt;br /&gt; private String isbn;&lt;br /&gt; private String title;&lt;br /&gt; private String author;&lt;br /&gt; private Integer
      numberOfPages;&lt;br /&gt; private Double weight;&lt;br /&gt; &lt;/strong&gt;&lt;br /&gt; public Long getId() {&lt;br /&gt; return id;&lt;br /&gt; }&lt;br /&gt; &lt;/code&gt;&lt;br /&gt; Then put the cursor position at line imediatlly after:&lt;br /&gt; &lt;code&gt;&lt;br /&gt; public void setId(Long id) {&lt;br /&gt; this.id = id;&lt;br /&gt; }&lt;br /&gt; &lt;/code&gt;&lt;/p&gt; &lt;p&gt;then press simultaneously: alt+insert, select Getter and Setter… then select all fields and click ok.&lt;/p&gt;
      &lt;p&gt;After creation of the Entity Class, let’s go to more one netbeans wizard wich will generate all necessary code to work with JPA and JSF files, so click in File-&gt;New File, in Persistence category, choose the option: JSF Pages From Entity Classes, and follow steps:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Choose Livro’s (or Book’s) Entity Classe (Picture 10)&lt;/li&gt; &lt;li&gt;Choose the packages where will be generated the files for JPA and JSF manipulation (Picture 11), here note that the option
      “Ajax-enable generated pages” is displayed, this option allows generated code to use Ajax technology, remember that this is only available from version 6.5 beta or the most recent version.&lt;/li&gt; &lt;/ol&gt; &lt;div style="width: 801px;" class="wp-caption alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/news/images/nb65beta_new_jsf_from_entity_class.gif" style="border: 0pt none;" title="Picture 10 - Select Entity Classes" height="515" width="791" alt="" border="0" /&gt;&lt;p
      class="wp-caption-text"&gt;Picture 10 - Select Entity Classes&lt;/p&gt;&lt;/div&gt; &lt;div style="width: 801px;" class="wp-caption alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/news/images/nb65beta_new_jsf_from_entity_class2.gif" style="border: 0pt none;" title="Picture 11 - Select packages to JPA and JSF" height="515" width="791" alt="" border="0" /&gt;&lt;p class="wp-caption-text"&gt;Picture 11 - Select packages to JPA and JSF&lt;/p&gt;&lt;/div&gt; &lt;p&gt;Now we have all necessary
      code, to test our project result, build the project (type Shift+11, clean and build project) click with right button in project name by Projects tab (Ctrl+1), after click “Undeploy and Deploy” to remove the web project of server (if there is) and deploy version that you already finished building (Picture 12).&lt;/p&gt; &lt;p&gt;If there are no errors message at Output tab (Ctrl+4), you can run the project using F6 key and see your CRUD working wonderful. (Pictures 13 and 14)&lt;/p&gt; &lt;div
      style="width: 308px;" class="wp-caption alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/news/images/nb65beta_undeploy_deploy.gif" style="border: 0pt none;" title="Picture 12 - Project Undeploy and Deploy" height="466" width="298" alt="" border="0" /&gt;&lt;p class="wp-caption-text"&gt;Picture 12 - Project Undeploy and Deploy&lt;/p&gt;&lt;/div&gt; &lt;div style="width: 683px;" class="wp-caption alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/news/images/nb65beta_new_livro.gif"
      style="border: 0pt none;" title="Picture 13 - CRUD finished, inserting a new registry" height="521" width="673" alt="" border="0" /&gt;&lt;p class="wp-caption-text"&gt;Picture 13 - CRUD finished, inserting a new registry&lt;/p&gt;&lt;/div&gt; &lt;div style="width: 683px;" class="wp-caption alignnone"&gt;&lt;img src="http://www.paulocanedo.com.br/news/images/nb65beta_livro_created.gif" style="border: 0pt none;" title="Picture 14 - CRUD finished, registries overview after insert confirmation"
      height="521" width="673" alt="" border="0" /&gt;&lt;p class="wp-caption-text"&gt;Picture 14 - CRUD finished, registries overview after insert confirmation&lt;/p&gt;&lt;/div&gt; &lt;p&gt;&lt;strong&gt;Conclusion