<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AMIS Technology Blog &#187; Wouter van Reeven</title>
	<atom:link href="http://technology.amis.nl/blog/author/wouter-van-reeven/feed/" rel="self" type="application/rss+xml" />
	<link>http://technology.amis.nl</link>
	<description></description>
	<lastBuildDate>Tue, 14 May 2013 14:03:30 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Getting started with PrimeFaces on GlassFish v3</title>
		<link>http://technology.amis.nl/2010/01/07/getting-started-with-primefaces-on-glassfish-v3/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-primefaces-on-glassfish-v3</link>
		<comments>http://technology.amis.nl/2010/01/07/getting-started-with-primefaces-on-glassfish-v3/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 23:38:46 +0000</pubDate>
		<dc:creator>Wouter van Reeven</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[glassfishv3]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[primefaces]]></category>

		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=6817</guid>
		<description><![CDATA[According to the PrimeFaces website, &#8220;PrimeFaces is an open source component suite for Java Server Faces featuring 70+ Ajax powered rich set of JSF components. Additional TouchFaces module features a UI kit for developing mobile web applications.&#8220;. Since it is an OpenSource JSF implementation that  [...]]]></description>
				<content:encoded><![CDATA[<p>According to <a href="http://www.primefaces.org/">the PrimeFaces website</a>, &#8220;<em>PrimeFaces is an open source component suite for Java Server Faces featuring 70+ Ajax powered rich set of JSF components. Additional TouchFaces module features a UI kit for developing mobile web applications.</em>&#8220;. Since it is an OpenSource JSF implementation that is very close to releasing JSF 2.0 compliant components, I figured it was time to try it out on GlassFish v3.<br />
<span id="more-6817"></span></p>
<p>A very easy and powerful way of creating Java EE 6 compliant applications, is to use NetBeans 6.8, which comes with great GlassFish v3 and Maven support. The first thing to do is to create a new Maven Web Application. The wizard that helps you create it allows you to specify the Java EE version, which in this case should be 6. In order to make sure the PrimeFaces libraries are included in your project, add the next dependency to your pom.xml file</p>
<pre class="wp-code-highlight prettyprint">&amp;lt;dependency&amp;gt;
 &amp;lt;groupId&amp;gt;org.primefaces&amp;lt;/groupId&amp;gt;
 &amp;lt;artifactId&amp;gt;primefaces&amp;lt;/artifactId&amp;gt;
 &amp;lt;version&amp;gt;2.0.0.RC&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;</pre>
<p>Since the PrimeFaces jars are hosted on the PrimeFaces Maven repository, you&#8217;ll need to add the repository as well:</p>
<pre class="wp-code-highlight prettyprint">&amp;lt;repository&amp;gt;
 &amp;lt;id&amp;gt;prime-repo&amp;lt;/id&amp;gt;
 &amp;lt;name&amp;gt;Prime Technology Maven Repository&amp;lt;/name&amp;gt;
 &amp;lt;url&amp;gt;http://repository.prime.com.tr/&amp;lt;/url&amp;gt;
 &amp;lt;layout&amp;gt;default&amp;lt;/layout&amp;gt;
&amp;lt;/repository&amp;gt;</pre>
<p>PrimeFaces makes use of a servlet to get hold of resources, like css and JavaScript. Therefore, you need to register the Resource Servlet in web.xml like this</p>
<pre class="wp-code-highlight prettyprint">&amp;lt;servlet&amp;gt;
 &amp;lt;servlet-name&amp;gt;Resource Servlet&amp;lt;/servlet-name&amp;gt;
 &amp;lt;servlet-class&amp;gt;org.primefaces.resource.ResourceServlet&amp;lt;/servlet-class&amp;gt;
&amp;lt;/servlet&amp;gt;
&amp;lt;servlet-mapping&amp;gt;
 &amp;lt;servlet-name&amp;gt;Resource Servlet&amp;lt;/servlet-name&amp;gt;
 &amp;lt;url-pattern&amp;gt;/primefaces_resource/*&amp;lt;/url-pattern&amp;gt;
&amp;lt;/servlet-mapping&amp;gt;</pre>
<h2>A split pane</h2>
<p>A simple index.xhtml file with a split pane may then look like this</p>
<pre class="wp-code-highlight prettyprint">&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
Â &amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&amp;gt;
Â &amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
      Â xmlns:h=&quot;http://java.sun.com/jsf/html&quot;
      Â xmlns:p=&quot;http://primefaces.prime.com.tr/ui&quot;&amp;gt;
 Â &amp;lt;head&amp;gt;
  Â &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;/&amp;gt;
  Â &amp;lt;title&amp;gt;PrimeFaces Test&amp;lt;/title&amp;gt;
  Â &amp;lt;p:resources /&amp;gt;
 Â &amp;lt;/head&amp;gt;
 Â &amp;lt;body&amp;gt;
  Â &amp;lt;p&amp;gt;
    &amp;lt;p:layout style=&quot;width:400px;height:200px;&quot;&amp;gt;
     &amp;lt;p:layoutUnit position=&quot;west&quot; size=&quot;100&quot;&amp;gt;Left Pane&amp;lt;/p:layoutUnit&amp;gt;
   Â  &amp;lt;p:layoutUnit position=&quot;center&quot;&amp;gt;Right Pane&amp;lt;/p:layoutUnit&amp;gt;
  Â  &amp;lt;/p:layout&amp;gt;
   &amp;lt;/p&amp;gt;
  &amp;lt;/body&amp;gt;
 &amp;lt;/html&amp;gt;</pre>
<p>which looks like this</p>
<p><a rel="attachment wp-att-6828" href="http://technology.amis.nl/blog/6817/getting-started-with-primefaces-on-glassfish-v3/primefaces_split_pane"><img class="alignnone size-full wp-image-6828" title="primefaces_split_pane" src="http://technology.amis.nl/wp-content/uploads/images/primefaces_split_pane.png" alt="" width="408" height="210" /></a></p>
<p>The left bar is the one being dragged by the mouse.</p>
<h2>File upload</h2>
<p>Another nice PrimeFaces component is the fileUpload component. It supports single and multiple file uploads. To be able to use the fileUpload component, a few Apache Commons dependencies need to be added:</p>
<pre class="wp-code-highlight prettyprint">&amp;lt;dependency&amp;gt;
 &amp;lt;groupId&amp;gt;commons-fileupload&amp;lt;/groupId&amp;gt;
 &amp;lt;artifactId&amp;gt;commons-fileupload&amp;lt;/artifactId&amp;gt;
 &amp;lt;version&amp;gt;1.2.1&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&amp;lt;dependency&amp;gt;
 &amp;lt;groupId&amp;gt;org.apache.commons&amp;lt;/groupId&amp;gt;
 &amp;lt;artifactId&amp;gt;commons-io&amp;lt;/artifactId&amp;gt;
 &amp;lt;version&amp;gt;1.3.2&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;</pre>
<p>Next, a filter needs to be added to web.xml and the JavaServer Faces state saving method should be set to server. So, add these lines to web.xml</p>
<pre class="wp-code-highlight prettyprint">&amp;lt;context-param&amp;gt;
 &amp;lt;param-name&amp;gt;javax.faces.PROJECT_STAGE&amp;lt;/param-name&amp;gt;
 &amp;lt;param-value&amp;gt;Development&amp;lt;/param-value&amp;gt;
&amp;lt;/context-param&amp;gt;
&amp;lt;context-param&amp;gt;
 &amp;lt;param-name&amp;gt;javax.faces.STATE_SAVING_METHOD&amp;lt;/param-name&amp;gt;
 &amp;lt;param-value&amp;gt;server&amp;lt;/param-value&amp;gt;
&amp;lt;/context-param&amp;gt;
&amp;lt;filter&amp;gt;
 &amp;lt;filter-name&amp;gt;PrimeFaces FileUpload Filter&amp;lt;/filter-name&amp;gt;
 &amp;lt;filter-class&amp;gt;org.primefaces.webapp.filter.FileUploadFilter&amp;lt;/filter-class&amp;gt;
 &amp;lt;init-param&amp;gt;
  &amp;lt;param-name&amp;gt;thresholdSize&amp;lt;/param-name&amp;gt;
  &amp;lt;param-value&amp;gt;51200&amp;lt;/param-value&amp;gt;
 &amp;lt;/init-param&amp;gt;
 &amp;lt;init-param&amp;gt;
  &amp;lt;param-name&amp;gt;uploadDirectory&amp;lt;/param-name&amp;gt;
  &amp;lt;param-value&amp;gt;/tmp&amp;lt;/param-value&amp;gt;
 &amp;lt;/init-param&amp;gt;
&amp;lt;/filter&amp;gt;
&amp;lt;filter-mapping&amp;gt;
 &amp;lt;filter-name&amp;gt;PrimeFaces FileUpload Filter&amp;lt;/filter-name&amp;gt;
 &amp;lt;servlet-name&amp;gt;Faces Servlet&amp;lt;/servlet-name&amp;gt;
&amp;lt;/filter-mapping&amp;gt;</pre>
<p>Then a JSF ManagedBean is needed to handle the file uploads. A very simple one, that doesn&#8217;t do anything with the uploaded files at all, may look like this</p>
<pre class="wp-code-highlight prettyprint">@ManagedBean(name = &quot;fileUploadController&quot;)
@RequestScoped
public class FileUploadController implements FileUploadListener {
 @Override
 public void processFileUpload(FileUploadEvent event) throws AbortProcessingException {
  System.out.println(&quot;Uploaded: &quot; + event.getFile().getFileName());
  FacesMessage msg = new FacesMessage(&quot;Succesful&quot;, event.getFile().getFileName() + &quot; is uploaded.&quot;);
  FacesContext.getCurrentInstance().addMessage(null, msg);
 }
}</pre>
<p>Finally, change index.xhtml to this</p>
<pre class="wp-code-highlight prettyprint">&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;
Â &amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&amp;gt;
Â &amp;lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;
      Â xmlns:h=&quot;http://java.sun.com/jsf/html&quot;
      Â xmlns:p=&quot;http://primefaces.prime.com.tr/ui&quot;&amp;gt;
 Â &amp;lt;head&amp;gt;
  Â &amp;lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=UTF-8&quot;/&amp;gt;
  Â &amp;lt;title&amp;gt;PrimeFaces Test&amp;lt;/title&amp;gt;
  Â &amp;lt;p:resources /&amp;gt;
 Â &amp;lt;/head&amp;gt;
 Â &amp;lt;body&amp;gt;
  Â &amp;lt;p&amp;gt;
   Â &amp;lt;h:form id=&quot;form&quot; enctype=&quot;multipart/form-data&quot; prependId=&quot;false&quot;&amp;gt;
    Â &amp;lt;p:growl id=&quot;messages&quot; /&amp;gt;
    Â &amp;lt;p:layout style=&quot;width:400px;height:200px;&quot;&amp;gt;
     Â &amp;lt;p:layoutUnit position=&quot;west&quot; size=&quot;100&quot;&amp;gt;Left Pane&amp;lt;/p:layoutUnit&amp;gt;
     Â &amp;lt;p:layoutUnit position=&quot;center&quot;&amp;gt;Right Pane&amp;lt;/p:layoutUnit&amp;gt;
    Â &amp;lt;/p:layout&amp;gt;
    Â &amp;lt;p:fileUpload fileUploadListener=&quot;#{fileUploadController.processFileUpload}&quot; id=&quot;documentToUpload&quot;
                  Â allowTypes=&quot;*.jpg;*.png;*.gif;&quot; description=&quot;Images&quot; update=&quot;messages&quot;/&amp;gt;
   Â &amp;lt;/h:form&amp;gt;
  Â &amp;lt;/p&amp;gt;
 Â &amp;lt;/body&amp;gt;
Â &amp;lt;/html&amp;gt;</pre>
<p>Redeploy and the result looks like this</p>
<p><a rel="attachment wp-att-6831" href="http://technology.amis.nl/blog/6817/getting-started-with-primefaces-on-glassfish-v3/primefaces_fileupload_1"><img class="alignnone size-full wp-image-6831" title="primefaces_fileUpload_1" src="http://technology.amis.nl/wp-content/uploads/images/primefaces_fileUpload_1.png" alt="" width="408" height="258" /></a></p>
<p><a rel="attachment wp-att-6832" href="http://technology.amis.nl/blog/6817/getting-started-with-primefaces-on-glassfish-v3/primefaces_fileupload_2"><img class="alignnone size-full wp-image-6832" title="primefaces_fileUpload_2" src="http://technology.amis.nl/wp-content/uploads/images/primefaces_fileUpload_2.png" alt="" width="409" height="317" /></a></p>
<p><a rel="attachment wp-att-6833" href="http://technology.amis.nl/blog/6817/getting-started-with-primefaces-on-glassfish-v3/primefaces_fileupload_3"><img class="alignnone size-full wp-image-6833" title="primefaces_fileUpload_3" src="http://technology.amis.nl/wp-content/uploads/images/primefaces_fileUpload_3.png" alt="" width="741" height="259" /></a></p>
<h2>Conclusion</h2>
<p>It is quite easy to get started with PrimeFaces using Maven and GlassFish. Please bear in mind that the fileUpload component is quite picky concerning the order in which the filters are specified in web.xml in case there is more than one. Please see <a href="http://primefaces.prime.com.tr/forum/viewtopic.php?f=3&amp;t=893">this forum thread</a> for more info.</p>
<p>In case you&#8217;re having troubles following the instructions in this blog, <a href="http://technology.amis.nl/wp-content/uploads/images/PrimeFacesTest.zip">here</a> is my NetBeans project. Since it is a Maven project you should be able to open it in Eclipse or any other IDE.</p>
]]></content:encoded>
			<wfw:commentRss>http://technology.amis.nl/2010/01/07/getting-started-with-primefaces-on-glassfish-v3/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Java EE 6 and GlassFish 3.0 released!</title>
		<link>http://technology.amis.nl/2009/12/10/glassfish-30-released/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=glassfish-30-released</link>
		<comments>http://technology.amis.nl/2009/12/10/glassfish-30-released/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 13:59:41 +0000</pubDate>
		<dc:creator>Wouter van Reeven</dc:creator>
				<category><![CDATA[ADF & JHeadstart]]></category>
		<category><![CDATA[AMIS]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[J(2)EE/Java]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Web/Java]]></category>
		<category><![CDATA[glassfishv3]]></category>
		<category><![CDATA[javaee6]]></category>

		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=6645</guid>
		<description><![CDATA[
	In the past few month several Java EE 6 related JSRs (Java Specification Requests) have been finalized. The final ballot for them ended on November 30 and all were approved. Today, December 10, 2009, Java EE 6 and GlassFish v3, THE reference implementation of Java EE6, are released.

	

	Four and  [...]]]></description>
				<content:encoded><![CDATA[<p>
	In the past few month several Java EE 6 related JSRs (Java Specification Requests) have been finalized. The final ballot for them ended on November 30 and all were approved. Today, December 10, 2009, Java EE 6 and GlassFish v3, <i><b>THE</b></i> reference implementation of Java EE6, are released.</p>
<p>
	<span id="more-6645"></span></p>
<p>
	Four and a half year after the release of Java EE 5 we enter the next Java EE era. GlassFish v3 is the first application server that fully supports all Java EE 6 technologies. The list of supported technologies includes, but is not limited, by</p>
<ul>
<li>
		Servlet 3.0</li>
<li>
		JSF 2.0</li>
<li>
		WebBeans</li>
<li>
		CDI (Contexts and Dependency Injection)</li>
<li>
		Bean Validation</li>
<li>
		EJB 3.1</li>
<li>
		JPA 2.0</li>
<li>
		JAX-RS</li>
</ul>
<p>
	GlassFish v3 can be downloaded in two flavours. The first one contains all of the Java EE 6 technologies, the second one contains all technologies that are specified in the Java EE 6 Web Profile specification.</p>
<p>
	If there was only one GlassFish v3/Java EE 6 thing I&#39;d like to mention then it would be that Java EE has become more powerful than ever before. Now we can do with annotations instead of XML configuration, we can do without ear files because war files are sufficient, Ajax has been standardized, and asynchronous calls are supported all the way from the client almost down to the database. And now you can do all that with GlassFish v3. A reason to celebrate? You bet it is!</p>
<p>
	<img src="https://glassfish-theme.dev.java.net/logo.gif" /></p>
<p>
	For those wanting to know all there is to know about GlassFish v3, please attend the Virtual Conference on December 15. For more info, see the <a href="http://www.sun.com/software/products/glassfishv3/GlassFish_Conference_Flyer.pdf" target="_blank">conference flyer</a>. You may also want to visit the <a href="http://glassfish.org" target="_blank">GlassFish Community Home-page</a> and the <a href="http://www.sun.com/glassfishv3" target="_blank">GlassFish Enterprise Home-page</a> (should be live any moment now). Finally, you can download the Java EE 6 SDK and find even more info at the <a href="http://java.sun.com/javaee" target="_blank">Java EE 6 homepage</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://technology.amis.nl/2009/12/10/glassfish-30-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Migrating your web applications from JEE5 to JEE6</title>
		<link>http://technology.amis.nl/2009/11/15/migrating-your-web-applications-from-jee5-to-jee6/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=migrating-your-web-applications-from-jee5-to-jee6</link>
		<comments>http://technology.amis.nl/2009/11/15/migrating-your-web-applications-from-jee5-to-jee6/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 16:05:04 +0000</pubDate>
		<dc:creator>Wouter van Reeven</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=6539</guid>
		<description><![CDATA[
	On Wednesday, November 11, the Netherlands Java Users Group (NL-JUG) organized the JFall 2009 Java conference. At the conference I had the pleasure of doing a presentation with a live demo about what steps can be taken to migrate an existing JEE5 web application to JEE6. The application ran on  [...]]]></description>
				<content:encoded><![CDATA[<p>
	On Wednesday, November 11, the Netherlands Java Users Group (NL-JUG) organized the JFall 2009 Java conference. At the conference I had the pleasure of doing a presentation with a live demo about what steps can be taken to migrate an existing JEE5 web application to JEE6. The application ran on GlassFish v2 and I migrated it to GlassFish v3 using NetBeans 6.8 Beta. This article describes my experiences with GlassFish v3 and NetBeans 6.8 Beta and it explains what steps I took to migrate from JEE5 to JEE6.</p>
<p>
	<span id="more-6539"></span></p>
<p>
	<strong>The demo application<br />
	</strong></p>
<p>
	The application I used for the presentation is a simple web application I wrote. It displays the contents of an astronomical database called the <a href="http://www.saguaroastro.org/content/downloads.htm">SAC (Saguaro Astronomy Club) database</a>. The database contains over 10,000 so called Deep Sky Objects. These are objetcs in space outside our solar system that are not stars, e.g. gaseous nebulae, star clusters and galaxies.</p>
<p>
	<a href="http://technology.amis.nl/wp-content/uploads/images/01-demo_app_example.png"><img alt="Screen shot of the demo application." class="size-medium wp-image-6541" height="153" src="http://technology.amis.nl/wp-content/uploads/images/01-demo_app_example-300x153.png" title="01-demo_app_example" width="300" /></a></p>
<p>
	From left to right columns are shown for the name and aleternate name of the object, it&#39;s position in the sky (R.A. = <a href="http://en.wikipedia.org/wiki/Right_ascension">Right Ascension</a>, dec = <a href="http://en.wikipedia.org/wiki/Declination">Declination</a>) and its brightness (<a href="http://en.wikipedia.org/wiki/Apparent_magnitude">Magnitude</a>). On the top of the table select boxes are shown that allows the user to filter the data. At the bottom of the page is a button to add a new object.</p>
<p>
	The application was built using NetBeans 6.7.1 on top of GlassFish v2. The pages are JSP pages with JSF tags in them. There is a JSF Managed Bean that communicates with a Local Session Bean. The Local Session Bean, finally, uses TopLink Essentials JPA to communicate with the database.</p>
<p>
	Both the Object Type (Star Cluster, Nebula, Galaxy etc.) and the Constellation of a Deep Sky Object are stored in separate tables and are connected to the Deep Sky Object by means of OneToMany associations. In order to deal correctly with these associations, I introduced two Converters. One Converter converts a Constellation to a String and back, the other does that for a DeepSkyType.</p>
<p>
	<strong>First steps to migrate to JEE6<br />
	</strong></p>
<p>
	During the presentation I showed what steps were needed to run the application on GlassFish v3. The short answer is: none! JEE6 is fully backward compatible with JEE5. Simply deploying the EAR on GlassFish v3 did the trick. However, since I wanted to use some new features of JEE6 in my application, I had to migrate parts of my application to JEE6.</p>
<p>
	First of all, TopLink Essentials no longer is used in GlassFish v3 as JPA layer. The reference implementation of JPA 2.0 is called EclipseLink. This essentially is an open source version of TopLink. The EclipseLink project is hosted under the Eclipse foundation and that is why TopLink was renamed to EclipseLink. Secondly, JSP no longer is the default view layer in JEE6. It has been replaced with Facelets. Facelets has been available for JEE5 for a long time now. Using the final build version of Facelets (version 1.1.14) would have worked on GlassFish v2. However, it does NOT work on GlassFish v3. The reason is that Facelets now is incorporated in JSF 2.0 while it was a separate technology with JSF 1.2. So, in order to migrate to Facelets, I had to migrate to JSF 2.0 as well.</p>
<p>
	The steps that were necessary to do so were</p>
<ul>
<li>
		create xhtml files for each jsp file, copy the contents over and make sure they are proper xhtml files</li>
<li>
		modify faces-config: make sure the version used is 2.0 instead of 1.2 and also make sure all references to jsp files are replaced by xhtml files</li>
<li>
		modify web.xml and make sure to configure it to use Facelets.</li>
</ul>
<p style="margin-bottom: 0mm;">
	The last step means adding this bit to web.xml</p>
<pre class="wp-code-highlight prettyprint">&amp;lt;!-- Facelets pages will use the .xhtml extension --&amp;gt;
&amp;lt;context-param&amp;gt;
    &amp;lt;param-name&amp;gt;javax.faces.FACELETS_VIEW_MAPPINGS&amp;lt;/param-name&amp;gt;
    &amp;lt;param-value&amp;gt;*.xhtml&amp;lt;/param-value&amp;gt;
&amp;lt;/context-param&amp;gt;</pre>
<p style="margin-bottom: 0mm;">
	Deploying the new EAR file showed the application to be working ok.</p>
<p style="margin-bottom: 0mm;">
	<strong>Introducing JEE6 stuff<br />
	</strong></p>
<p style="margin-bottom: 0mm;">
	In JEE5 an application with both a web part (in a WAR) and an EJB part (in a JAR) needed to be deployed in an EAR (WAR + JAR) file. One of the changes that comes with JEE6 is that EAR files no longer are needed. Now it suffices to have a WAR that contains both the web part and the EJB part. There are two ways to accomplish this. One way is to add all EJB classes in a separate JAR and place that in the lib dir within WEB-INF. Another way is to have all EJB classes in the same class structure as the web classes (Managed Beans, Converters etc.) and deploy all of it in a single WAR. I chose the latter way.</p>
<p style="margin-bottom: 0mm;">
	To do so, I created a new Web Application project in NetBeans 6.8 Beta and chose JEE6 as Java EE version.</p>
<p style="margin-bottom: 0mm;">
	<a href="http://technology.amis.nl/wp-content/uploads/images/02-new-app-with-jee6.png"><img alt="" class="alignnone size-medium wp-image-6545" height="177" src="http://technology.amis.nl/wp-content/uploads/images/02-new-app-with-jee6-300x177.png" title="02-new-app-with-jee6" width="300" /></a></p>
<p style="margin-bottom: 0mm;">
	<br />
	Then I copied over all pages, sources, style sheets and configuration files to the new project. Undeploying the old project and deploying the new showed the new application to work totally fine.</p>
<p style="margin-bottom: 0mm;">
	The next step was to get rid of faces-config.xml. In JSF 2.0 it is no longer necessary to define all Managed Bean and Converters in faces-config. Instead, they can be annotated with the @ManagedBean and @FacesConverter annotations. Navigation is implicidly done depending of the outcome of an Action. I, for instance, the addAction returns a String &quot;add&quot;, then JSF will try to find the view named &quot;add&quot; and navigate to it. In my case it means that JSF will navigate to add.xhtml to add a new Deep Sky Object to the database.</p>
<p style="margin-bottom: 0mm;">
	Without any content in faces-config, the file may be deleted. Doing so, however, resulted in a FileNotFoundException thrown by GlassFish over and over again. The bug that was reported for this already has been resolved.</p>
<p style="margin-bottom: 0mm;">
	Finally, I was able to show the functionality of the Bean Validation framework. This new JEE specification looks a lot like the Hibernate Validation framework. There are annotations like @NotNull, @Size, @Min, @Max, @DecimalMin, @DecimalMax and @Pattern to validate the data in, e.g., Entity classes before they are persisted in the database. One thing to be aware of is that @NotNull doesn&#39;t really work on String members. The reason is, that JSF will always submit an empty String in a form and &quot;&quot; != null! So beware to use the @Size annotation on String members.</p>
<p style="margin-bottom: 0mm;">
	<strong>Stuff prepared but not shown<br />
	</strong></p>
<p style="margin-bottom: 0mm;">
	Regrettably time went rather quickly during the presentation. I had prepared a fair bit about the new Metamodel and Criteria APIs in JPA 2.0 but I didn&#39;t have enough time to show more of it that just a quick code example. This was the only part of my preparations in which I encountered incomplete APIs. According to the Proposed Final Draft of the JPA 2.0 specifications there should be a @TypeSafeMetamodel annotation that indicates that a class is a Metamodel class for an Entity. The annotation, however, doesn&#39;t exist in the current version of EclipseLink 2. Apart form that I found the example code in the JPA 2.0 specification to slightly differ from the implementation in EclipseLink. With some puzzling, however, I was able to create a working example of the Criteria API. That is very good news indeed. A few months ago we hosted a session on JPA 2.0 at AMIS and then the Criteria API wasn&#39;t even available yet.</p>
<p style="margin-bottom: 0mm;">
	<strong>Conclusions<br />
	</strong></p>
<p style="margin-bottom: 0mm;">
	All in all I am very much impressed by the state of the reference implementationsof the forthcoming JEE specs. I hardly encountered any problems at all. If I encountered a problem, like one I had with my Converters suddenly stopping working when I switched to JSF 2.0, it turned out to be an error in my code. Both NetBeans 6.8 Beta and GlassFish v3 proved to be very stable and very pleasant to work with. If you have a chance to check out JEE6 stuff, I suggest you do it now!</p>
]]></content:encoded>
			<wfw:commentRss>http://technology.amis.nl/2009/11/15/migrating-your-web-applications-from-jee5-to-jee6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making GlassFish v3 available using Apache2 and mod_jk</title>
		<link>http://technology.amis.nl/2009/08/14/making-glassfish-v3-available-using-apache2-and-mod_jk/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=making-glassfish-v3-available-using-apache2-and-mod_jk</link>
		<comments>http://technology.amis.nl/2009/08/14/making-glassfish-v3-available-using-apache2-and-mod_jk/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 09:55:23 +0000</pubDate>
		<dc:creator>Wouter van Reeven</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=5973</guid>
		<description><![CDATA[The upcoming release of JEE 6 means that the next release of GlassFish, version 3, still is under development. However, it is stable enough to try out many features of JEE 6 already. apart from support for JEE 6, the integration with mod_jk has significantly improved recently. Earlier this week I  [...]]]></description>
				<content:encoded><![CDATA[<p>The upcoming release of JEE 6 means that the next release of GlassFish, version 3, still is under development. However, it is stable enough to try out many features of JEE 6 already. apart from support for JEE 6, the integration with mod_jk has significantly improved recently. Earlier this week I followed the steps in <a href="http://weblogs.java.net/blog/amyroh/archive/2009/06/running_glassfi.html">this blog of Amy Roh</a> to make GlassFish v3 available on port 80 using Apache2 and mod_jk. The steps described here are for Debian Lenny, but may equally well be followed for other Linux distributions or Windows.</p>
<p><span id="more-5973"></span><strong>Installing and configure Apache2 and mod_jk</strong></p>
<p>Let&#8217;s start with installing Apache2 and mod_jk. On Debian Lenny, mod_jk is dependend on apache2-mpm. Fortunately, both apt-get and dselect will resolve all dependencies for you if you select mod_jk, so install everything you need for instance with</p>
<pre class="wp-code-highlight prettyprint">
apt-get install libapache2-mod-jk
</pre>
<p>Installing mod_jk this way will ensure that the mod_jk module is enabled for Apache2. You can check and verify that with</p>
<pre class="wp-code-highlight prettyprint">
$ ls -l /etc/apache2/mods-enabled/jk.load
lrwxrwxrwx 1 root root 25 2009-08-12 14:18 /etc/apache2/mods-enabled/jk.load -&amp;gt; ../mods-available/jk.load
</pre>
<p>In case the module is missing from the monds-enabled directory, you can enable it with</p>
<pre class="wp-code-highlight prettyprint">
a2enmod jk
</pre>
<p>Once everything is installed you need to configure Apache and mod_jk. To keep my installation clean I created a directory called jk under the Apache2 config directory /etc/apache2. In this directory I placed my workers.properties file, which reads</p>
<pre class="wp-code-highlight prettyprint">
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.socket_timeout=300
</pre>
<p>A minimum workers.properteis file should have worker.list, worker.worker1.type, worker.worker1.host and worker.worker1.port. That&#8217;s all for mod_jk.</p>
<p>As for Apache2, I had to do two things. first of all, I needed to add the configuration settings to enable mod_jk in the Apache2 httpd.conf file. On Debian, however, this file is empty and apache2.conf is used instead. This file gets overwritten when you upgrade Apache2, so the best way to include the mod_jk config is to create a new file under the /etc/apach2/conf.d directory and put everything in there.</p>
<p>So I created a file called /etc/apache2/conf.d/jk and put this in there:</p>
<pre class="wp-code-highlight prettyprint">
# Where to find workers.properties
JkWorkersFile /etc/apache2/jk/workers.properties
# Where to put jk logs
JkLogFile /var/log/apache2/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat &amp;quot;[%a %b %d %H:%M:%S %Y] &amp;quot;
# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat &amp;quot;%w %V %T&amp;quot;
# Locattion of shm file
JkShmFile /etc/apache2/jk/jk.shm</pre>
<p>The only other thing to do is to specify which URL paths should be redirected to mod_jk. Debian by default uses Virtual Hosts and Apache2 requires that each Virtual Host has their own settings for which URL path to redirect. So I added these lines to /etc/apache2/sites-enabled/default within the &lt;VirtualHost&gt;&lt;/VirtualHost&gt; tags:</p>
<pre class="wp-code-highlight prettyprint">
# Send everything for context /examples to worker named worker1 (ajp13)
JkMount /GFTest/* worker1
</pre>
<p>That&#8217;s it for Apache2.</p>
<p><strong>Installing and configuring GlassFish v3</strong></p>
<p>GlassFish v3 can be downloaded from <a href="http://download.java.net/glassfish/v3/promoted/">this URL</a>. I used promoted build 57 (which probably will be the next preview release) but build 53 or later will do. Since I set up everything on a server with no graphical UI I downloaded the zip, but the Windows or UNIX/Linux installer will also do. I unzipped the zip in /usr/local/glassfish.</p>
<p>After starting up GlassFish with</p>
<pre class="wp-code-highlight prettyprint">
/usr/local/glassfish/glassfihv3/bin/asadmin start-domain
</pre>
<p>I had to create an HTTP listeren on port 8009 and enable jk on it. This can be done with these two commands</p>
<pre class="wp-code-highlight prettyprint">
asadmin create-http-listener --listenerport 8009 --listeneraddress 0.0.0.0 --defaultvs server jk-connector
asadmin set configs.config.server-config.network-config.network-listeners.network-listener.jk-connector.jk-enabled=true
</pre>
<p>Running a netstat afterwards to see if port 8009 was up revealed &#8230; no port 8009! The reason is that GlassFish v3 is OSGi enabled and only will start the Web container if a web application is deployed. So, I deployed a test application and port 8009 was taken as well! The result shows a count of rows in a table in my database displayed in a JSF 2.0 page based on <a href="http://blogs.sun.com/enterprisetechtips/entry/true_abstraction_composite_ui_components">this blog by Ed Burns</a> (hence the similar text and colors):</p>
<p><a href="http://technology.amis.nl/wp-content/uploads/images/jee6-demo.jpg"><img width="300" height="120" src="http://technology.amis.nl/wp-content/uploads/images/jee6-demo.jpg" alt="" title="jee6-demo" class="alignnone size-medium wp-image-5977" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://technology.amis.nl/2009/08/14/making-glassfish-v3-available-using-apache2-and-mod_jk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>More impressions of JavaOne 2009</title>
		<link>http://technology.amis.nl/2009/06/14/more-impressions-of-javaone-2009/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=more-impressions-of-javaone-2009</link>
		<comments>http://technology.amis.nl/2009/06/14/more-impressions-of-javaone-2009/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 14:41:42 +0000</pubDate>
		<dc:creator>Wouter van Reeven</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=5583</guid>
		<description><![CDATA[Like my colleague Lucas I attended JavaOne 2009. This post will describe my impressions of JavaOne 2009. The event turned out to be a mix of great things. I attended loads of great sessions, I met many great people and I had an awesome time in San Francisco.
By the way, did you already hear of our  [...]]]></description>
				<content:encoded><![CDATA[<p>Like my colleague Lucas I attended JavaOne 2009. This post will describe my impressions of JavaOne 2009. The event turned out to be a mix of great things. I attended loads of great sessions, I met many great people and I had an awesome time in San Francisco.</p>
<p>By the way, did you already hear of our upcoming session &quot;Our JavaOne report&quot; that we will hold on Tuesday, June 16 at Amis? For more info and how to register see <a href="http://www.amis.nl/activiteiten.php?id=738">this link</a>.</p>
<p>Pardon me for that shameless plug. Please read on for the rest of the article <img alt="" style="width: 12px; height: 12px;" src="http://technology.amis.nl/blog/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/msn/regular_smile.gif" /></p>
<p><span id="more-5583"></span><strong>Great sessions</strong></p>
<p>Most of the sessions I attended were about JEE 5 and JEE 6. The JEE 5 ones were about performance optimizing existing code. I attended a session about optimizing JPA which provided some great tips and tricks for optimizing the JPA layer of your app. I didn&#8217;t learn many new things there, which indicates that my knowledge about this topic is quite accurate. Another performance session I attended was about optimizing Ajax requests and page loads. This one turned out to be quite informative with a few very nice tips. Some of them are</p>
<p>- dereference JavaScript variables when you leave a page to free up memory<br />
- break up variable calls like divs[i].style.color into separate variables. Apparently that&#8217;s a LOT faster!<br />
- make fewer HTTP requests, e.g. by combining small images into one larger an and only display that image partly<br />
- put stylesheets in the HEAD and JavaScript at the bootom of a page</p>
<p>Apart form these JEE 5 sessions I attended quite a few JEE 6 sessions. One session deeply dove into using EJB 3.1 Embeddable containers in JSE apps. The embeddalble EJB container will be part of the EJB 3.1 spec so it&#8217;s good to know about it.</p>
<p>Then there was a &quot;Meet the JPA Expert Group session&quot; which turned out to be very nice. Linda DeMichiels let the audience ask questions and when we ran out of them, she started asking questions at us! Anyone who&#8217;s sceptic about expert groups not listening to the community should have attended that session. I have never been sceptic about that, and the session has proved me right.</p>
<p><strong>The sessions AMIS hosted</strong></p>
<p>This year AMIS hosted no less than three sessions at JavaOne. Lucas presented about SaaS enabling JavaServer Faces applications. I got to present about FishCAT, the GlassFish Community Acceptance Test that I participate in, and about automatic integration testing web applications with Ant (or Maven), Selenium and TestNG. I didn&#8217;t attend Lucas&#8217; session, but I got the impression that my sessions were received pretty well. Here&#8217;s an image of Lucas and I at JavaOne.</p>
<p>&nbsp;<a href="http://technology.amis.nl/wp-content/uploads/images/dsc_0149.jpg"><img height="199" width="300" class="alignnone size-medium wp-image-5585" title="Lucas and I at JavaOne 2009" src="http://technology.amis.nl/wp-content/uploads/images/dsc_0149.jpg" alt="Lucas and I at JavaOne 2009" /></a></p>
<p><strong>Meeting great people</strong></p>
<p>JavaOne typically is a conference where all kinds of people can be found. There are simple developers and end users like myself, which are most of the people. But there also are many developers of well known frameworks, like Seam, IceFaces, HtmlUnit etc. Then there are the Expert Group members : the great minds that participate in the Java Community Process (JCP) and that create the specifications for JPA, EJB, JSF and the like.</p>
<p>Since I presented the session on FishCAT at CommunityOne on Monday, I got to meet many of the people behind GlassFish. First and foremost the GlassFish Quality Team members, lead by Judy Tang whom I did my session with. And Adam Bien, who&#8217;s got a <a href="http://www.adam-bien.com/">great blog on JEE</a> and who also participates in FishCAT, was there too. Here&#8217;s an image of Judy, Homer, Adam and myself.</p>
<p><a href="http://technology.amis.nl/wp-content/uploads/images/dsc_02291.jpg"><img height="199" width="300" src="http://technology.amis.nl/wp-content/uploads/images/dsc_02291.jpg" alt="From right to left Adam, Homer, Judy and myself." title="From right to left Adam, Homer, Judy and myself." class="size-medium wp-image-5594" /></a></p>
<p>&nbsp;</p>
<p>Then I got to meet Doug Clarke, who&#8217;s technical lead of EclipseLink. On July 7 we will host a session on JPA 2.0 at AMIS and I talked to Doug about that session. Doug kindly made his slides available for us and suggested I talk to Mike Keith for exercises. I did but unfortunately Mike didn&#8217;t have any JPA 2.0 exercises ready yet. I promised I will send him our exercises which we&#8217;ll do <img alt="" style="width: 12px; height: 12px;" src="http://technology.amis.nl/blog/wp-content/plugins/fckeditor-for-wordpress-plugin/smiles/msn/wink_smile.gif" /></p>
<p><strong>Awesome time</strong></p>
<p>In summary, JavaOne 2009 was great. I learned a lot and met many great people. If you never have been to JavaOne, please consider doing so. Well, that is if there&#8217;s another JavaOne next year. With the Sun acquisition of Oracle, <a href="http://technology.amis.nl/blog/5526/javaone-2009-opening-and-general-session-first-glimpse-of-oracle-sun">which Lucas wrote about</a>, anything may be possible. In any case, hope to see you at JavaOne next year!</p>
]]></content:encoded>
			<wfw:commentRss>http://technology.amis.nl/2009/06/14/more-impressions-of-javaone-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RichFaces plugin for NetBeans updated</title>
		<link>http://technology.amis.nl/2009/04/12/richfaces-plugin-for-netbeans-updated/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=richfaces-plugin-for-netbeans-updated</link>
		<comments>http://technology.amis.nl/2009/04/12/richfaces-plugin-for-netbeans-updated/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 12:49:57 +0000</pubDate>
		<dc:creator>Wouter van Reeven</dc:creator>
				<category><![CDATA[AMIS]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[J(2)EE/Java]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Java, JEE, OAS and WebLogic Server]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Web/Java]]></category>

		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=5216</guid>
		<description><![CDATA[About a year ago, during JavaOne 2008, Geertjan Wielenga and I created NetBeans modules for JBoss RichFaces support. Last week we updated the modules so now version 3.3.0.GA of RichFaces is supported. I updated the components palette with the newest a4j and rich tags. Geertjan introduced some new  [...]]]></description>
				<content:encoded><![CDATA[<p>About a year ago, during JavaOne 2008, <a href="http://blogs.sun.com/geertjan/">Geertjan Wielenga</a> and I created <a href="https://nbrichfacessupport.dev.java.net/">NetBeans modules for JBoss RichFaces support</a>. Last week we updated the modules so now version 3.3.0.GA of RichFaces is supported. I updated the components palette with the newest a4j and rich tags. Geertjan introduced some new images for the palette entries, which now look like this</p>
<p><a href="http://technology.amis.nl/wp-content/uploads/images/richfaces-palette-with-new-images.jpg"><img height="300" width="234" class="alignnone size-medium wp-image-5217" title="richfaces-palette-with-new-images" alt="" src="http://technology.amis.nl/wp-content/uploads/images/richfaces-palette-with-new-images.jpg" /></a></p>
<p>Even better, Geertjan produced <a href="https://nbrichfacessupport.dev.java.net/tutorials/quick-start/">a quick start turorial</a>. Check out <a href="http://blogs.sun.com/geertjan/entry/3_3_0_richfaces_support">Geertjans weblog article</a> for where to download the modules.</p>
]]></content:encoded>
			<wfw:commentRss>http://technology.amis.nl/2009/04/12/richfaces-plugin-for-netbeans-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing seam-gen in Seam 2.1.2-SNAPSHOT with GlassFish v2</title>
		<link>http://technology.amis.nl/2009/03/31/testing-seam-gen-in-seam-212-snapshot-with-glassfish-v2/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=testing-seam-gen-in-seam-212-snapshot-with-glassfish-v2</link>
		<comments>http://technology.amis.nl/2009/03/31/testing-seam-gen-in-seam-212-snapshot-with-glassfish-v2/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 19:33:20 +0000</pubDate>
		<dc:creator>Wouter van Reeven</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=5168</guid>
		<description><![CDATA[On March 15 I read on The Aquarium that JBoss&#8217; Dan Allen added JBoss AS 5 and GlassFish support to seam-gen. I had the pleasure to have met with Dan Allen at Devoxx 2008 (we hosted a BOFF on GlassFish and Seam) and there he already mentioned thinking about adding support for GlassFish to seam-gen.  [...]]]></description>
				<content:encoded><![CDATA[<p>On March 15 I read on <a href="http://blogs.sun.com/theaquarium/entry/seam_gen_now_supports_glassfish">The Aquarium</a> that JBoss&#8217; Dan Allen <a href="http://in.relation.to/Bloggers/JBossAS5AndGlassFishSupportAddedToSeamgen">added JBoss AS 5 and GlassFish support to seam-gen</a>. I had the pleasure to have met with Dan Allen at Devoxx 2008 (we hosted a BOFF on GlassFish and Seam) and there he already mentioned thinking about adding support for GlassFish to seam-gen. Tonight I downloaded Seam 2.1.2-SNAPSHOT and tried out the GlassFish support in seam-gen that Dan recently added.</p>
<p><span id="more-5168"></span>My goal for this test was to find out how seam-gen can be used to generate the kind projects <a href="http://www.amis.nl">AMIS</a> usually develops: web based applications that use an Oracle database underneath. Only now I would like to generate a project that can be deployed to GlassFish. So, I started seam-gen:</p>
<pre class="wp-code-highlight prettyprint">
$ ./seam-gen
</pre>
<p><strong>First check: specifying the GlassFish install directory</strong></p>
<p>Call me hasty, a bad reader, impatient or just out of luck, but having read <a href="http://in.relation.to/Bloggers/JBossAS5AndGlassFishSupportAddedToSeamgen">Dans blog article</a> I had the impression that I could specify the GlassFish install directory in the questionaire presented by seam-gen. However, I was a bit disappointed to find out that I still need to provide a JBoss AS install dir. Reading Dans blog article more carefully provided me with the info I missed the first time: <em>&quot;As before, the seam-gen project build supports JBoss AS by default&quot;</em> &#8230; <em>&quot;All of the targets that pertain to GlassFish reside in the file glassfish-build.xml at the root of the project&quot;</em>.OK, so I have to specify a JBoss AS home at seam-gen time and the I&#8217;ll be able to deploy to GlassFish once I am done generating? That&#8217;s definately cool and enough for me!</p>
<p><strong>Next check: hibernate-gen</strong></p>
<p>One of the first things I checked was if a nasty bug in hibernate-gen is still there. In the process of setting up your project, seam-gen uses hibernate-gen: the Hibernate generation tool that generates Entity classes based on database connection parameters. The older version I used a few months ago didn&#8217;t handle Oracle database schemas well. Instead of only generating Entity classes for the schema of the provided database user, it would scan the entire database and attempt to generate Entity classes for all database tables and views that it encountered. The workaround for it was to specify hibernate.default_schema in hibernate-console.properties and then generate the Entity classes.</p>
<p>Fortunately, even without specifying this parameter hibernate now does a great job. It simply scans the database schema for the provided user and that&#8217;s it. Excellent!</p>
<p><strong>Managing GlassFish from within ant</strong></p>
<p>As can be read in glassfish-readme.txt in the project home, GlassFish can be started, restarted and stopped using ant. Also, deploying, redeploying and undeploying projects and datasource definitions all can be done with ant. Pretty neat Dan! Unfortunately I am not a very exprienced ant user, so it took a while before I found out I had to specify the glassfish.home directory in the build.properties file. Once I did, I could start and stop GlassFish without any problems.</p>
<p>Despite the little annoyances described above so far I was *VERY* much impressed with the excellent job that seam-gen does! Remember: this is SNAPSHOT software and so far it has done a really great job! No crashes, no exceptions, no stack traces but only comprehensive messages on my screen whenever something wasn&#8217;t configuered correctly. So, here&#8217;s:</p>
<p><strong>The final test: deploying my project to GlassFish</strong></p>
<p>A project that uses JPA should, by GlassFish terms, be deployed as an EAR. However, by Seam standards it&#8217;s perfectly ok to deploy it as a WAR file. So, I followed the Seam standards and tried for the WAS option. Here I ran into a few problems.</p>
<p>Let me start by describing my efforts to deploy an exploded archive: this goes without any problems whatsoever! The ant script totally kicks ass at this task. It doesn&#8217;t need to first create an exploded archive (task: gf-stage) or deploy a datasource (task: gf-gf-deploy-datasource). If it needs to, it will do it by itself!</p>
<p>However, deploying a WAR file gave me quite a headache. The first error I encountered was</p>
<pre class="wp-code-highlight prettyprint">
Deployment Error -- Could not resolve a persistence unit corresponding to the persistence-unit-ref-name [SeamGenTest/pu] in scope of the module called
[.../glassfish-v2ur2/domains/domain1/applications/j2ee-modules/SeamGenTest]. Please verify your application.
</pre>
<p>As it turns out, the build.xml script removes the persistence.xml file in case of a WAR file. However, deploying an exploded WAR goes fine, so it *HAS* a persistence.xml file. This seems inconsistent to me.</p>
<p>Apart from that I had to replace these variables in resources/WEB-INF/component.xml</p>
<pre class="wp-code-highlight prettyprint">
@debug@
@jndiPattern@
@seamEmfRef@
</pre>
<p>with the values I found in the components.xml file in the exploded war directory. It looks like ant doesn&#8217;t succesfully replace these placeholders with their correct values. Once I did that, the WAR would deploy without any problems.</p>
<p><strong>Conclusion</strong></p>
<p>GlassFish support for seam-gen is getting there and looking very, very promising. A great big thanks to Dan Allen for working on this! I will send him my comments and I hope he will be able to resolve the issues I mentioned here.</p>
]]></content:encoded>
			<wfw:commentRss>http://technology.amis.nl/2009/03/31/testing-seam-gen-in-seam-212-snapshot-with-glassfish-v2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Multi select in RichFaces trees</title>
		<link>http://technology.amis.nl/2009/01/29/multi-select-in-richfaces-trees/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=multi-select-in-richfaces-trees</link>
		<comments>http://technology.amis.nl/2009/01/29/multi-select-in-richfaces-trees/#comments</comments>
		<pubDate>Thu, 29 Jan 2009 19:46:14 +0000</pubDate>
		<dc:creator>Wouter van Reeven</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=4710</guid>
		<description><![CDATA[In the past few months I have been involved in a development project where we are using Hibernate, Seam and RichFaces. One of the requirements of our customer is to have a hierarchical data structure represented in a tree structure. We found that the RichFaces rich:tree component meets all the  [...]]]></description>
				<content:encoded><![CDATA[<p>In the past few months I have been involved in a development project where we are using Hibernate, Seam and RichFaces. One of the requirements of our customer is to have a hierarchical data structure represented in a tree structure. We found that the RichFaces rich:tree component meets all the requirements we have. Well, all but one: rich:tree is single select only, not multi select. Or is it?</p>
<p><span id="more-4710"></span><strong>Some theory behind the rich:tree component</strong></p>
<p>The RichFaces rich:tree component is a component that can display hierachical data in two ways. The first way is to display a org.richfaces.model.TreeNode with its children. The RichFaces API also provides a default implementation of the org.richfaces.model.TreeNode interface, which is the org.richfaces.model.TreeNodeImpl class.</p>
<p>The second way is to use a RichFaces rich:recursiveTreeNodesAdaptor to display a java.util.List or array of any kind of object, as long as it has some member that holds a java.util.List or array of child objects. Due to some heavy preprocessing of the data that is displayed in the tree, along with us feeling more comfortable with java.util.List we choose this approach in our project. In this article I&#8217;ll use the first approach to show that our solution also works in this case.</p>
<p><strong>Building a simple rich:tree</strong></p>
<p>To be able to display a rich:tree in a JSF page, you need few simple classes. The first class I used is called SelectionBean and it looks like this</p>
<pre class="wp-code-highlight prettyprint">
import org.richfaces.event.NodeSelectedEvent;
import org.richfaces.model.TreeNode;
import org.richfaces.model.TreeNodeImpl;

public class SelectionBean {

    private TreeNode rootNode = new TreeNodeImpl();

    public SelectionBean() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeNodeImpl childNode = new TreeNodeImpl();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; childNode.setData(&amp;quot;childNode&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; childNode.setParent(rootNode);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rootNode.addChild(&amp;quot;1&amp;quot;, childNode);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeNodeImpl childChildNode1 = new TreeNodeImpl();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; childChildNode1.setData(&amp;quot;childChildNode1&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; childChildNode1.setParent(childNode);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; childNode.addChild(&amp;quot;1.1&amp;quot;, childChildNode1);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TreeNodeImpl childChildNode2 = new TreeNodeImpl();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; childChildNode2.setData(&amp;quot;childChildNode2&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; childChildNode2.setParent(childNode);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; childNode.addChild(&amp;quot;1.2&amp;quot;, childChildNode2);
    }

    public void processTreeNodeImplSelection(final NodeSelectedEvent event) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;Node selected : &amp;quot; + event);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; public TreeNode getRootNode() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return rootNode;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}</pre>
<p>It creates a simple TreeNode hierarchy that can be displayed in a tree with the following Facelets JSF page:</p>
<pre class="wp-code-highlight prettyprint">
&amp;lt;?xml version=&#039;1.0&#039; encoding=&#039;UTF-8&#039; ?&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.0 Transitional//EN&amp;quot; &amp;quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&amp;quot;&amp;gt;
&amp;lt;html xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:ui=&amp;quot;http://java.sun.com/jsf/facelets&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:h=&amp;quot;http://java.sun.com/jsf/html&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:f=&amp;quot;http://java.sun.com/jsf/core&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:a4j=&amp;quot;http://richfaces.org/a4j&amp;quot;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:rich=&amp;quot;http://richfaces.org/rich&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;body&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:form id=&amp;quot;main&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a4j:outputPanel ajaxRendered=&amp;quot;true&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;rich:panel id=&amp;quot;treePanel&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;f:facet name=&amp;quot;header&amp;quot;&amp;gt;Tree&amp;lt;/f:facet&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;rich:tree id=&amp;quot;tree&amp;quot; ajaxSubmitSelection=&amp;quot;true&amp;quot; switchType=&amp;quot;ajax&amp;quot; value=&amp;quot;#{selectionBean.rootNode}&amp;quot; var=&amp;quot;node&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;rich:treeNode&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:outputText value=&amp;quot;#{node}&amp;quot;/&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/rich:treeNode&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/rich:tree&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/rich:panel&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/a4j:outputPanel&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/h:form&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;</pre>
<p>The result looks like this:</p>
<p><img height="115" width="432" style="" src="http://technology.amis.nl/wp-content/uploads/images/01-simple-richfaces-tree.jpg" alt="" title="01-simple-richfaces-tree" class="alignnone size-medium wp-image-4717" /></p>
<p>Quite simple, like I said.</p>
<p><strong>Multi select in the rich:tree</strong></p>
<p>The SelectionBean class has been prepared to catch node selection events. If you modify the rich:tree line in the Facelets JSF page to read like this</p>
<pre class="wp-code-highlight prettyprint">
&amp;lt;rich:tree id=&amp;quot;tree&amp;quot; ajaxSubmitSelection=&amp;quot;true&amp;quot; switchType=&amp;quot;ajax&amp;quot;
    value=&amp;quot;#{selectionBean.rootNode}&amp;quot; var=&amp;quot;node&amp;quot;
    nodeSelectListener=&amp;quot;#{selectionBean.processTreeNodeImplSelection}&amp;quot;&amp;gt;</pre>
<p>you should see selection events being registered in the log of your application server:</p>
<pre class="wp-code-highlight prettyprint">
Node selected : org.richfaces.event.AjaxSelectedEvent[source=org.richfaces.component.html.HtmlTree@19eaa86]</pre>
<p>Not very helpful information, but at least we know that the node selection events are registered. Now, if you look at <a href="http://www.jboss.org/file-access/default/members/jbossrichfaces/freezone/docs/devguide/en/html/tree.html">the taglib doc for rich:tree</a> you&#8217;ll notice that there is no way to configure the tree to accept multiple selections. So let&#8217;s modify the SelectionBean to keep track of node selections itself.</p>
<p>We&#8217;ll need some Set to hold the selected tree nodes in. We could use a List, but that will create doubles if we click a node more than one time. Remember, rich:tree has no way of knowing if a node recently was selected or not. So everytime we click a node that rich:tree thinks not to be selected, it raises a selection event again! We only want to know which nodes are clicked and keep track of that. we don&#8217;t want to know how many times a node is selected. So therefore a Set will do nicely.</p>
<p>There&#8217;s one more thing to a rich:tree. Its backing UIComponent is a org.richfaces.component.html.HtmlTree and in the TreeModel of that tree, each node is uniquely identified by a RowKey Object. So, I&#8217;ll use a</p>
<pre class="wp-code-highlight prettyprint">
private Map&amp;lt;Object, TreeNode&amp;gt; selectedNodes = new HashMap&amp;lt;Object, TreeNode&amp;gt;();</pre>
<p>Now, everytime a node is selected I&#8217;ll add its TreeNode to the Map under the RowKey key. Assuming we have a global Map member as defined above, the processTreeNodeImplSelection method can now be modified to</p>
<pre class="wp-code-highlight prettyprint">
    public void processNodeSelection(final NodeSelectedEvent event) {
        HtmlTree tree = (HtmlTree)event.getComponent();
        Object rowKey = tree.getRowKey();
        TreeNode selectedNode = tree.getModelTreeNode(rowKey);
        selectedNodes.put(rowKey, selectedNode);
        for (Object curRowKey : selectedNodes.keySet()) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&amp;quot;Selected node : &amp;quot; + selectedNodes.get(curRowKey).getData());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }</pre>
<p>If you click the three nodes in the tree in some random order, you&#8217;ll get this output:</p>
<pre class="wp-code-highlight prettyprint">
Selected node : childChildNode1
Selected node : childNode
Selected node : childChildNode2</pre>
<p>So, we are keeping track of all selected nodes!</p>
<p><strong>Making the selected nodes visible in the tree</strong></p>
<p>Now our bean knows that we have selected multiple nodes, but the tree still displays only one selected node at a time. Using e.g. FireBug it&#8217;s easy to determine the difference is CSS class between a selected node and a non-selected node. Using the default Blue skin for RichFaces, a non-selected node has style class</p>
<pre class="wp-code-highlight prettyprint">
dr-tree-h-text rich-tree-node-text</pre>
<p>while a selected node has style class</p>
<pre class="wp-code-highlight prettyprint">
dr-tree-h-text rich-tree-node-text dr-tree-i-sel rich-tree-node-selected</pre>
<p>The border around a selected node is there because of the dr-tree-i-sel style. We only need a way to make all selected nodes (that is, the ones that are stored in the Map in our bean) use that style. One way is to tell each TreeNode that is has been selected. But how can we do that? Well, for instance by introducing a class that holds both the text that will be displayed in the tree as well as a Boolean that holds the selection state of the node. Such a class could be like this</p>
<pre class="wp-code-highlight prettyprint">
public class NodeData {
    private String nodeText;

    private Boolean selected = Boolean.FALSE;

    public NodeData(String nodeText) {
        this.nodeText = nodeText;
    }

    [getters and setters]
}</pre>
<p>With this class we need to make a few changes to our SelectionBean. First of all, when building the node hierarchy we need to use the NodeData class instead of a simple String. This means we&#8217;ll have to modify the constructor method so it looks like this</p>
<pre class="wp-code-highlight prettyprint">
    public SelectionBean() {
        TreeNodeImpl childNode = new TreeNodeImpl();
        childNode.setData(new NodeData(&amp;quot;childNode&amp;quot;));
        childNode.setParent(rootNode);
        rootNode.addChild(&amp;quot;1&amp;quot;, childNode);
        TreeNodeImpl childChildNode1 = new TreeNodeImpl();
        childChildNode1.setData(new NodeData(&amp;quot;childChildNode1&amp;quot;));
        childChildNode1.setParent(childNode);
        childNode.addChild(&amp;quot;1.1&amp;quot;, childChildNode1);
        TreeNodeImpl childChildNode2 = new TreeNodeImpl();
        childChildNode2.setData(new NodeData(&amp;quot;childChildNode2&amp;quot;));
        childChildNode2.setParent(childNode);
        childNode.addChild(&amp;quot;1.2&amp;quot;, childChildNode2);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }</pre>
<p>Next, the processNodeSelection method needs to tell a node that it is selected by setting the selected Boolean in NodeData to true. The method becomes</p>
<pre class="wp-code-highlight prettyprint">
    public void processNodeSelection(final NodeSelectedEvent event) {
        HtmlTree tree = (HtmlTree)event.getComponent();
        Object rowKey = tree.getRowKey();
        TreeNode selectedNode = tree.getModelTreeNode(rowKey);
        ((NodeData)selectedNode.getData()).setSelected(Boolean.TRUE);
        selectedNodes.put(rowKey, selectedNode);
        for (Object curRowKey : selectedNodes.keySet()) {
            System.out.println(&amp;quot;Selected node : &amp;quot; + ((NodeData)selectedNodes.get(curRowKey).getData()).getNodeText());
        }
    }</pre>
<p>Finally, we need to modify our Facelets JSF page in two ways. The first one is to make sure the h:outputText element displays the nodeText of the NodeData. The second modification is to have the rich:treeNode set it&#8217;s nodeClass accordingly to the selected NodeData Boolean. The Facelets JSF page lines look like this</p>
<pre class="wp-code-highlight prettyprint">
&amp;lt;rich:treeNode nodeClass=&amp;quot;#{node.selected?&#039;dr-tree-i-sel&#039;:&#039;&#039;}&amp;quot;&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h:outputText value=&amp;quot;#{node.nodeText}&amp;quot;/&amp;gt;
&amp;lt;/rich:treeNode&amp;gt;</pre>
<p>Now, if you reload the application in your browser, all of a sudden you can &quot;select&quot; multiple nodes in the tree.</p>
<p><img height="111" width="413" alt="" src="http://technology.amis.nl/wp-content/uploads/images/02-multi-select-in-tree.jpg" title="02-multi-select-in-tree" class="alignnone size-medium wp-image-4736" /></p>
<p><strong>Future enhancements</strong></p>
<p>The above scenario isn&#8217;t ideal. First of all, now single selection of nodes doesn&#8217;t work anymore. To fix this, you may want to add a checkbox that toggles the selection state from single to multiple and back. Another issue is that accidentically selected nodes cannot be deselected anymore. The selection state checkbox may partially solve that, however. Once you select a node that you didn&#8217;t want to select, toggle the checkbox, select a single node, then toggle the checkbox again and start selecting multiple nodes once more. Another way would be to have another checkbox that allows you to deselect any selected node. Finally, users may want to hold a key, e.g. the CTRL key, and then start selecting multiple nodes. I haven&#8217;t got a clue how to do that, so if you know please drop me an email <img src='http://technology.amis.nl/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Ideally the RichFaces rich:tree would have native multiple selection support. Perhaps this post will actually make that possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://technology.amis.nl/2009/01/29/multi-select-in-richfaces-trees/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Devoxx 2008: The major announcements</title>
		<link>http://technology.amis.nl/2008/12/11/devoxx-2008-the-major-announcements/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=devoxx-2008-the-major-announcements</link>
		<comments>http://technology.amis.nl/2008/12/11/devoxx-2008-the-major-announcements/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 16:20:36 +0000</pubDate>
		<dc:creator>Wouter van Reeven</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[devoxx]]></category>
		<category><![CDATA[javafx]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[jvm]]></category>
		<category><![CDATA[scala]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=4361</guid>
		<description><![CDATA[At the time I&#8217;m writing this, Devoxx 2008 is well into it&#8217;s second day. Day one was quite interesting, with the major announcement being the release of JavaFX 1.0 last week. Apart from that, IBM presented their RFID technology, which has been incorporated into our access badges. Day two held  [...]]]></description>
				<content:encoded><![CDATA[<p>At the time I&#8217;m writing this, Devoxx 2008 is well into it&#8217;s second day. Day one was quite interesting, with the major announcement being the release of JavaFX 1.0 last week. Apart from that, IBM presented their RFID technology, which has been incorporated into our access badges. Day two held another major announcement: all of Java will be made modular. That means not only the SDK, but also the JRE and even the JVM. Expected release date of JDK 7: somewhere in 2010&#8230;<br />
<span id="more-4361"></span>Back to day one. JavaFX is here! It was announced a week ago and of course it&#8217;s the biggest thing this year at Devoxx. Remarkably enough, only one non-keynote presentation was about JavaFX! Flex is there as are Ajax and JSF. So, despite the big announcement there still was a balance in the presentations.</p>
<p>For some reason a major topic this year is security. No less than three presentations dealt with this topic, of which I attended two. Mike Wiesner talked us through his extensive knowledge on the topic of security in his presentation entitled &#8220;Security Patterns Reveiled&#8221;. One of the tips that were reveiled is that the Secure Base Action (coming from the Core Security Patterns book) isn&#8217;t always the best solution. The problem lies in the fact that the SecureBaseAction class needs to be extended. In Java, only single inheritance is allowed, so extending the SecureBaseAction class would disable your class to extend another class. The solution lies in using Bean Validation which is described in JSR 303.</p>
<p>The second security related presentation I attended was &#8220;The thread is out there! XML threads and DataPower&#8221; by Bill Hines. Bill&#8217;s presentation started out with a great overview of possible hacks that can be performed using XML. The most striking example he showed was a perfectly valid piece of XML with recursive namespace definitions. The result was a browser rapidly consuming more and more memory which eventually would lead to hangning his laptop. Imagine this happening to your ESB&#8230; Unfortunately the presentation ended up in a sales pitch for several of IBM&#8217;s products, despite Bill ensuring us several times he&#8217;s not a slaes person.</p>
<p>Next Scala was up. Bill Venners talked us through &#8220;The Feel Of Scala&#8221; which presented Bills view on Scala explained in the context of ScalaTest, a unit test project for Scala. As it turns out, Scala appears to be a very flexible language with many nice features that Java doesn&#8217;t have. When I was at JavaOne earlier this year I heard some people predict Scala to be the next Java. Now I understand why they clamied that. We will definately have a Knowledge Center evening at AMIS about Scala!</p>
<p>The final presentation I attended at day one was &#8220;Modularity In Java Using OSGi&#8221; by Peter Kriens. Peter gave us an excellent high leven introduction in the principles and concepts behind OSGi. Explaining why and how OSGi was first developerd and how it eveolved from there proved to be an excellent way of providing us with insights of OSGi. My next action on this matter will be to actually have a look in how to code with OSGi.</p>
<p>The rest of the day was filled with JBoss and Seam. First, my colleague Alan and I attended a BOF (Birds Of a Feather) on Seam, Hibernate and JBoss Tools lead by Pete Muir, Max Anderson and Dan Allen. The BOF was a relaxed and jolly Q&amp;A mostly about Seam and WebBeans. It was interesting to see that Seam is quite popular and that JBoss is working hard on WebBeans. Pete predicted an alpha version of WebBeans to be available this or next week.</p>
<p>After the BOF we checked in at our hotel and then went to a JBoss Meetup. The Benelux JBoss Users Group had organized one in CafÃ© au Lait (which translates to coffee with milk). Unfortunately, the JBoss presenters of the BOF arrived after Alan and I had left the cafÃ©.</p>
<p><span style="font-size: larger;"><strong>Day two</strong></span></p>
<p>Day two started off with Joshua Bloch doing a little promotion of his new book, Effective Java Programming Language 2. Joshua presented a bunch of very interesting cases for which he showed us how to improve Java code that people generally write. The examples he gave included a mnemonic about generics. The mnemonic is PECS. I will take no credit for this useful mnemonic, so google for Joshua Bloch and PECS to find out what I&#8217;m talking about. Thanks again to Joshua for signing his book I bought for AMIS later that day.</p>
<p>After this Mark Reinold was one. His presentation was originally titled &#8220;Java SE 7 Updated&#8221; but was renamed to &#8220;Modularity in Java SE&#8221;. When I was at JavaPolis (now Devoxx) last year there was a huge discussion between the audience and Roberto Cinicci about a Java Modularity JSR (JSR 277) and OSGi. A year later, Mark Reinold told us that JSR 277 is no more. Instead, JSR 294 is alive now and dealing with modularity in Java. Mark explained why OSGi just isn&#8217;t enough: you&#8217;d want modularity in all of Java, so also in the JVM, JRE and SDK, and not just on top of it. However, there are still big debates going on about how this should be put into the Java language specs as we speak.</p>
<p>Mark went on to tell about JDK 7 features that may be expected. Big ones to be expected by Sun include Modularization, VM support for dynamic languages (JRS 292), NIO2 (JSR 203) and the Swing Application Framework (JSR 296). There will most probably also be smaller features to be expected by Sun. Apart from that, non-Sun features to be expected include Annotatons Of Java Types (JSR 308) and some concurrency updates on top of JSR 166. Mark also told us that there are some features that we may NOT erxpect in JDK 7, being Closures and Beans Binding (JSR 295). Expected release date of JDK 7: somewhere in 2010!</p>
<p>So, day two still goes on. I&#8217;ll write about it and day three in a few days.</p>
]]></content:encoded>
			<wfw:commentRss>http://technology.amis.nl/2008/12/11/devoxx-2008-the-major-announcements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JDeveloper 11g on Linux</title>
		<link>http://technology.amis.nl/2008/10/07/jdeveloper-11g-on-linux/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jdeveloper-11g-on-linux</link>
		<comments>http://technology.amis.nl/2008/10/07/jdeveloper-11g-on-linux/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 09:23:25 +0000</pubDate>
		<dc:creator>Wouter van Reeven</dc:creator>
				<category><![CDATA[ADF & JHeadstart]]></category>
		<category><![CDATA[AMIS]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[J(2)EE/Java]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Oracle Development Tools]]></category>
		<category><![CDATA[Web/Java]]></category>

		<guid isPermaLink="false">http://technology.amis.nl/blog/?p=3571</guid>
		<description><![CDATA[It has been awaited for a long time. But now it&#8217;s finally there: JDeveloper 11g! At the time of this writing (Tuesday, October 7, 11:20 AM CEST), only the Linux download works. Fortunately I run Debian on my laptop. Here&#8217;s some screenshots of the installation.

First of all prove of the fact that I  [...]]]></description>
				<content:encoded><![CDATA[<p>It has been awaited for a long time. But now it&#8217;s finally there: JDeveloper 11g! At the time of this writing (Tuesday, October 7, 11:20 AM CEST), only the Linux download works. Fortunately I run Debian on my laptop. Here&#8217;s some screenshots of the installation.</p>
<p><img title="The remainder of this blog post is shown after " alt="...." src="./wp-content/plugins/xinha4wp/xinha_core/plugins/InsertMore/img/ed_more.png" id="showmore" /><span id="more-3571"></span></p>
<p align="baseline">First of all prove of the fact that I have the latest installation file: WebLogic is included.</p>
<p><img src="http://technology.amis.nl/wp-content/uploads/images/weblogic-included.jpg" width="600"/></p>
<p>Installation in progress:</p>
<p><img border="0" align="baseline" vspace="0" hspace="0" src="http://technology.amis.nl/wp-content/uploads/images/installation-in-progress.jpg" />&nbsp;</p>
<p align="baseline">The new QuickStart screen</p>
<p><img src="http://technology.amis.nl/wp-content/uploads/images/11g-quickstart.jpg" /></p>
<p align="baseline">And finally, there it is:</p>
<p><img width="600" src="http://technology.amis.nl/wp-content/uploads/images/11g-running.jpg" /></p>
]]></content:encoded>
			<wfw:commentRss>http://technology.amis.nl/2008/10/07/jdeveloper-11g-on-linux/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
