<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>Weiqi Gao&#039;s Observations - jsf tag</title>
  <link>http://www.weiqigao.com/blog/tags/jsf/</link>
  <description>Sharing My Experience...</description>
  <language>en</language>
  <copyright>Weiqi Gao</copyright>
  <lastBuildDate>Fri, 11 May 2012 12:48:36 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  <image>
    <url>http://pebble.sourceforge.net/common/images/powered-by-pebble.gif</url>
    <title>Weiqi Gao&#039;s Observations</title>
    <link>http://www.weiqigao.com/blog/</link>
  </image>
  
  
  <item>
    <title>Dan Troesser: JSF and ASP.NET Side By Side</title>
    <link>http://www.weiqigao.com/blog/2006/10/27/dan_troesser_jsf_and_asp_net_side_by_side.html</link>
    
      
        <description>
          &lt;p&gt;Dan Troesser is this month&#039;s OCI Java lunch speaker.  He&#039;ll be talking about something that I&#039;ve been interested in but haven&#039;t has a chance to get into deeply: JSF and ASP.NET&lt;/p&gt;

&lt;p&gt;First person is Dan now.&lt;/p&gt;

&lt;p&gt;We are going to talk about ASP.NET and compare it with JSF.  I have been learning about JSF for the past year and a half.  I have heard people talking about ASP.NET as something that&#039;s similar to JSF.  So I investigated ASP.NET myself.  I also looked into NetBeans 5.5 Beta.  If you haven&#039;t looked at NetBeans, you should.&lt;/p&gt;

&lt;p&gt;I&#039;m just going to demo some stuff.&lt;/p&gt;

&lt;p&gt;Dan has installed NetBeans 5.5 Beta 2 and GlassFish, the Sun Java EE server in the demo machine.  It also have MS SQL Server Express and Visual Web Developer Express.&lt;/p&gt;

&lt;p&gt;Dan is starting up the SQL Server service now.  And it is started now.&lt;/p&gt;

&lt;p&gt;Dan is bringing up the Microsoft SQL Server tool, showing the data that is prepopulated: some inventory data.&lt;/p&gt;

&lt;p&gt;Dan is startign up Visual Studio 2005 now.&lt;/p&gt;

&lt;p&gt;I got a free copy of VS 2005 from a Microsoft event for free last year.&lt;/p&gt;

&lt;p&gt;From VS 2005, Dan is creating a website: Shopping.  Just a couple of clicks.&lt;/p&gt;

&lt;p&gt;With ASP.NET, they try to get you to do stuff in the GUI designer and hide the code.  You can get at the code, you they want you to use the GUI.&lt;/p&gt;

&lt;p&gt;Dan drags a grid view onto the form, and maps it to data.  You create a data source for each component on the form.&lt;/p&gt;

&lt;p&gt;Now Dan hit Control-F5 to run it.  And the data showed up.&lt;/p&gt;

&lt;p&gt;If I wanted to edit the data, I can go back to the design view of the form to &#034;enable paging&#034;, &#034;enable sorting&#034;, and &#034;enable editing&#034;, &#034;enable deleting.&#034;  Unfortunately, we can&#039;t enable deleting from the GUI.&lt;/p&gt;

&lt;p&gt;Now I can sort, edit a row and delete a row.&lt;/p&gt;

&lt;p&gt;I a few steps, I had just created a simple app that does simple editing.&lt;/p&gt;

&lt;p&gt;I can also format the columns.&lt;/p&gt;

&lt;p&gt;I do have to turn HTML encoding off.  That was listed as an ASP.NET issue.&lt;/p&gt;

&lt;p&gt;The next thing I want to do is to create a page that allows me to insert a new column.&lt;/p&gt;

&lt;p&gt;Dan drags a details view control onto the form and set up a data source.  When generate the data source, Dan uses an advanced feature that has a check box that says &#034;generate INSERT ...&#034;&lt;/p&gt;

&lt;p&gt;Then Dan enabled enserting on the control, and made the default mode to be inserting.&lt;/p&gt;

&lt;p&gt;A Control-F5 and the page showed up.&lt;/p&gt;

&lt;p&gt;Dan drags a hyper link on to one of the pages.&lt;/p&gt;

&lt;p&gt;I wish using the hyper link is easier.&lt;/p&gt;

&lt;p&gt;We also want to enable an event in the details view, onItemInsert and hook it up with a method.&lt;/p&gt;

&lt;p&gt;Dan then added the method to the .cs file of the page.&lt;/p&gt;

&lt;p&gt;I&#039;m going to call Server.Transfer() to transfer the control to the other page.&lt;/p&gt;

&lt;p&gt;Dan hit a snag upon running this page and resorted to using a pre-build version of the demo.&lt;/p&gt;

&lt;p&gt;Now I can edit, I can delete items.&lt;/p&gt;

&lt;p&gt;That&#039;s just a simple little idea of how you can do thing in Visual Studio.&lt;/p&gt;

&lt;p&gt;Now I&#039;m going to switch to NetBeans.&lt;/p&gt;

&lt;p&gt;Dan starts NetBeans 5.5 Beta 2.  It&#039;s turning on modules now.&lt;/p&gt;

&lt;p&gt;The release candidate works pretty good now.  When I installed the SQL Server JDBC driver, I have to install it into the proper &#034;domain&#034;.&lt;/p&gt;

&lt;p&gt;I&#039;m going to start a new project.  I&#039;m creating an enterprise project.&lt;/p&gt;

&lt;p&gt;I don&#039;t really need an EJB module, just want to create the web application.&lt;/p&gt;

&lt;p&gt;We have some configuration files.  It actually created two projects, an enterprise project and a war project.  The configuration files doesn&#039;t contain much.&lt;/p&gt;

&lt;p&gt;I want to enable JSF.  With JSF, everything is within a &#034;f:view&#034; tag.  For the most part, it&#039;s a code centric approach.  The JSF project has a simple little start page.&lt;/p&gt;

&lt;p&gt;Now I want to create some database connections.  I create &#034;entities from databases&#034;.&lt;/p&gt;

&lt;p&gt;Dan picks the tables and the columns from some wizard screens.&lt;/p&gt;

&lt;p&gt;I selected the inventory table.  I want to create a persistence unit.  I choose the TopLink.  I haven&#039;t tried anything else.&lt;/p&gt;

&lt;p&gt;Dan shows us the data bound classes that&#039;s created for us.  It&#039;s a JPA annotated POJO class.  NetBeans also warns us that one of our names is a SQL-92 keyword.&lt;/p&gt;

&lt;p&gt;Dan now creates JSP pages from a wizard.&lt;/p&gt;

&lt;p&gt;Dan starts the GlassFish application server.&lt;/p&gt;

&lt;p&gt;Dan shows the pages in IE.&lt;/p&gt;

&lt;p&gt;I can select each item, edit it.  I can delete things. I can add a new inventory item.  And so forth.&lt;/p&gt;

&lt;p&gt;So we are able to create a view of this database table pretty easily.&lt;/p&gt;

&lt;p&gt;Now let&#039;s take a look at what was created.&lt;/p&gt;

&lt;p&gt;Dan gives a lesson on JSF.  The message tag, the form tag with its action attribute.&lt;/p&gt;

&lt;p&gt;Dan clicks on the method name on the JSF page and NetBeans moves to the method in a generated InventoryControler class.&lt;/p&gt;

&lt;p&gt;The navigation rules are specified in configuration files.&lt;/p&gt;

&lt;p&gt;We can bind input fields to the fields on the generated entity classes.&lt;/p&gt;

&lt;p&gt;The data table on the JSF page is the most complicated component.  It uses collections from inventory.inventoriys.&lt;/p&gt;

&lt;p&gt;It&#039;s pretty neat what it created for us.  And it&#039;s pretty easy to go forward from here.&lt;/p&gt;

&lt;p&gt;Brian now want Dan to change the getInventorys to a properly spelled out method name.  NetBean&#039;s refactoring doesn&#039;t go as far as to also change what&#039;s on the JSP.&lt;/p&gt;

&lt;p&gt;I just want to compare what JSF and ASP.NET in a very simple application.  And they come out pretty much even.&lt;/p&gt;

&lt;p&gt;Theron asked if JSF is taking off.  Dan sais it is.&lt;/p&gt;

&lt;p&gt;Brian brought up the Google Web Toolkit and has some very good word for it.&lt;/p&gt;

&lt;p&gt;The lunch is over.  First person is Weiqi now.&lt;/p&gt;

&lt;p&gt;What Dan showed is on par with what the Ruby on Rails folks showed.&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.weiqigao.com/blog/2006/10/27/dan_troesser_jsf_and_asp_net_side_by_side.html#comments</comments>
    <guid isPermaLink="true">http://www.weiqigao.com/blog/2006/10/27/dan_troesser_jsf_and_asp_net_side_by_side.html</guid>
    <pubDate>Fri, 27 Oct 2006 17:39:21 GMT</pubDate>
  </item>
  
  <item>
    <title>JSF, Facelets, Seam At The JUG</title>
    <link>http://www.weiqigao.com/blog/2006/06/08/jsf_facelets_seam_at_the_jug.html</link>
    
      
        <description>
          &lt;p&gt;&lt;em&gt;(My replacement DSL modem arrived from Speakeasy today.  And it worked.  Hurray!)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Tonight&#039;s &lt;a href= &#034;http://www.ociweb.com/javasig/&#034; &gt;St. Louis JUG&lt;/a&gt; meeting is again a very interesting one.  Jay Meyer from &lt;a href= &#034;http://www.harpoontech.com/&#034; &gt;Harpoon Technologies&lt;/a&gt; talked about Java Server Faces.&lt;/p&gt;

&lt;p&gt;In stark contrast with the last JSF talk at the JUG &lt;a href= &#034;http://www.weiqigao.com/blog/2005/08/12/ive_seen_the_jsf_future_and_weare_not_in_it.html&#034; &gt;300 days ago&lt;/a&gt;, Jay&#039;s presentation is done from a Java web developers point of view.  Having been to one too many JSF talks where the speaker can&#039;t seem to be able to extricate themselves from the JSF architecture diagrams for the first 30 minutes, Jay&#039;s straightforward approach of showing sample codes and talking very frankly about the advantages and shortcomings of JSF resonated with most of the over 40 Java developers in attendance.  The interchange between the speaker and the audience members are very animated.  Many good points were voiced by both the speaker and the audiences.&lt;/p&gt;

&lt;p&gt;I will post a link the the presentation material as soon as it is uploaded to the JUG web site.  However, my take away from this talk is this&amp;mdash;Use &lt;a href= &#034;https://facelets.dev.java.net/&#034; &gt;Facelets&lt;/a&gt;, &lt;a href= &#034;http://myfaces.apache.org/&#034; &gt;MyFaces&lt;/a&gt;, &lt;a href= &#034;http://www.jboss.com/products/seam&#034; &gt;Seam&lt;/a&gt;, &lt;a href= &#034;http://www.jcp.org/en/jsr/detail?id=220&#034; &gt;EJB3&lt;/a&gt;.&lt;p&gt;

&lt;p&gt;[&lt;b&gt;Update&lt;/b&gt;] The presentation slides are &lt;a href= &#034;http://www.ociweb.com/javasig/knowledgebase/2006-06/JSF.ppt&#034; &gt;here&lt;/a&gt;.  Be sure to take a look at it.  It&#039;s a fun one.&lt;/p&gt;

&lt;hr align=&#034;center&#034; noshade=&#034;noshade&#034; size=&#034;1&#034; width=&#034;60%&#034;&gt;

&lt;p&gt;Other tidbits from the JUG:&lt;/p&gt;

&lt;p&gt;In the Q&amp;amp;A session, I asked if anyone is using Maven.  Only one or two people raised their hands.  Raj Patel explained how he tried Maven and didn&#039;t feel comfortable about the extra things that Maven is doing to the project.  Of the people who used Maven one asked &#034;voluntarily?&#034;  On the other hand, when I asked about Ant, almost everyone raised their hands.&lt;/p&gt;

&lt;hr align=&#034;center&#034; noshade=&#034;noshade&#034; size=&#034;1&#034; width=&#034;60%&#034;&gt;

&lt;p&gt;Someone asked the question about unit testing private methods.  A long discussion ensued with Jeff Grigg suggesting that if you feel the need to test that particular private method then perhaps that method belongs to another class as a public method.  I did not get a chance to say it, but my feeling is that private methods should be only unit tested through public interfaces.&lt;/p&gt;

&lt;hr align=&#034;center&#034; noshade=&#034;noshade&#034; size=&#034;1&#034; width=&#034;60%&#034;&gt;

&lt;p&gt;Everybody is still looking for strong Java developers.  For job opportunities at OCI see &lt;a href= &#034;http://www.ociweb.com/careers/career_opportunities.html&#034; &gt;our careers page&lt;/a&gt;.&lt;/p&gt;

&lt;hr align=&#034;center&#034; noshade=&#034;noshade&#034; size=&#034;1&#034; width=&#034;60%&#034;&gt;

&lt;p&gt;Oh, have I mentioned that I&#039;m using &lt;a href= &#034;http://www.google.com/tools/firefox/toolbar/index.html&#034; &gt;Google Toolbar&lt;/a&gt; now.  Its spell checking feature fits my way of blogging just right&amp;mdash;now I can just click on the &lt;img align=&#034;top&#034; src=&#034;http://www.weiqigao.com/blog/images/google-toolbar-spell-check.png&#034; title=&#034;Google Toolbar spell check button&#034;/&gt; and do it in the editing text area.&lt;/p&gt;

&lt;center&gt;
&lt;img src=&#034;http://www.weiqigao.com/blog/images/checking.png&#034; title=&#034;Spell checking a test area&#034;/&gt;
&lt;/center&gt;
        </description>
      
      
    
    
    
    <comments>http://www.weiqigao.com/blog/2006/06/08/jsf_facelets_seam_at_the_jug.html#comments</comments>
    <guid isPermaLink="true">http://www.weiqigao.com/blog/2006/06/08/jsf_facelets_seam_at_the_jug.html</guid>
    <pubDate>Fri, 09 Jun 2006 04:07:06 GMT</pubDate>
  </item>
  
  <item>
    <title>Things To Look Into</title>
    <link>http://www.weiqigao.com/blog/2005/09/22/things_to_look_into.html</link>
    
      
        <description>
          &lt;p&gt;Continuing my tradition of &lt;a href= &#034;http://www.weiqigao.com/blog/2003/09/11/things_to_look_into.html&#034; &gt;making a list&lt;/a&gt; of things that I &lt;a href= &#034;http://www.weiqigao.com/blog/2005/01/19/things_to_look_into.html&#034; &gt;ought to know&lt;/a&gt;.  Here&#039;s a few things that I think merits some deeper examination:&lt;/p&gt;

&lt;dl style=&#034;margin-left:3em&#034;&gt;
&lt;dt&gt;&lt;a href= &#034;http://www.jboss.com/products/seam&#034; &gt;JBoss Seam&lt;/a&gt; &lt;span style=&#034;font-family:monospace;color:red&#034;&gt;&lt;--JSF&amp;amp;EJB3 framework, no Springs, no Struts, just an app server and me&lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;The announcement is &lt;a href= &#034;http://blog.hibernate.org/cgi-bin/blosxom.cgi/2005/09/19#seam&#034;
&gt;here&lt;/a&gt;.  The product page is &lt;a href= &#034;http://www.jboss.com/products/seam&#034; &gt;here&lt;/a&gt;.  The documentation is &lt;a href= &#034;http://docs.jboss.com/seam/reference/en/html/index.html&#034; &gt;here&lt;/a&gt;.  More info &lt;a href= &#034;http://blog.hibernate.org/cgi-bin/blosxom.cgi/2005/09/21#components&#034; &gt;here&lt;/a&gt;.  Accolades &lt;a href= &#034;http://raibledesigns.com/page/rd?anchor=seam&#034; &gt;here&lt;/a&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;a href= &#034;http://msdn.microsoft.com/netframework/future/linq/&#034; &gt;LINQ&lt;/a&gt; &lt;span style=&#034;font-family:monospace;color:red&#034;&gt;&lt;--Language INtegrated Query, sprinkle selects in C# code&lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;The video is &lt;a href= &#034;http://channel9.msdn.com/showpost.aspx?postid=114680&#034; &gt;here&lt;/a&gt;.  The in depth coverage is &lt;a href= &#034;http://blogs.tedneward.com/2005/09/22/Language+Innovation+C+30+Explained.aspx&#034; &gt;here&lt;/a&gt;.  The debate is &lt;a href= &#034;http://sqljunkies.com/WebLog/ktegels/archive/2005/09/21/16855.aspx&#034; &gt;here&lt;/a&gt;, &lt;a href= &#034;http://weblogs.asp.net/pwilson/archive/2005/09/15/425281.aspx&#034; &gt;here&lt;/a&gt;, and &lt;a href= &#034;http://www.knowing.net/CommentView,guid,065ce6c6-2c40-4e9d-97ca-8099e21213f4.aspx&#034; &gt;here&lt;/a&gt;.  And of course the podcast is &lt;a href= &#034;http://weblog.infoworld.com/udell/2005/09/19.html&#034; &gt;here&lt;/a&gt; (actually &lt;a href= &#034;http://weblog.infoworld.com/udell/gems/ju_linq.mp3&#034; &gt;here&lt;/a&gt;.)&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;I should list more items, but I really couldn&#039;t find anything more that&#039;s worth writing about.  Indeed, nowadays when Java people meet, the conversation goes something like this: &#034;What&#039;s new in the Java world?&#034;  &#034;Nothing.  Everything is old news now&amp;mdash;AOP, Spring, Hibernate, etc.&#034;&lt;/p&gt;

&lt;p&gt;Don&#039;t make me learn Ruby! &lt;tt&gt;&amp;lt;scream/&gt;&lt;/tt&gt;&lt;/p&gt;
        </description>
      
      
    
    
    
    <comments>http://www.weiqigao.com/blog/2005/09/22/things_to_look_into.html#comments</comments>
    <guid isPermaLink="true">http://www.weiqigao.com/blog/2005/09/22/things_to_look_into.html</guid>
    <pubDate>Thu, 22 Sep 2005 05:06:27 GMT</pubDate>
  </item>
  
  </channel>
</rss>

