<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Neil Griffin</title>
  <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/rss" />
  <subtitle>Neil Griffin</subtitle>
  <entry>
    <title>Utilizing instance storage (ephemeral storage) with RHEL on Amazon EC2</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/utilizing-instance-storage-ephemeral-storage-with-rhel-on-amazon-ec2" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/utilizing-instance-storage-ephemeral-storage-with-rhel-on-amazon-ec2</id>
    <updated>2011-09-03T10:54:07Z</updated>
    <published>2011-09-02T22:59:43Z</published>
    <summary type="html">&lt;h2&gt;
	Introduction&lt;/h2&gt;
&lt;p&gt;
	I recently had the opportunity to launch an Amazon EC2 instance and setup Liferay &amp;amp; MySQL. There were a couple of hurdles that I had to overcome, so I thought I would share the solutions I came up with.&lt;/p&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&lt;h2&gt;
		Storage: Ephemeral or EBS?&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
	When you launch an RHEL instance on EC2, the disk storage that is provided is a VERY SMALL (7 GB or less) root partition that is contained within the instance itself. This type of storage is called &lt;em&gt;ephemeral.&lt;/em&gt;&amp;nbsp;The benefit of ephemeral storage is that it doesn't cost any extra money. The drawback is that it can't participate in the EBS backup solution provided by Amazon -- you'll need to backup files across the network instead. Depending on the size of the instance, you will be given additional ephemeral storage, which is where you can potentially store data or install an app server for Liferay. The Amazon documentation indicates that this will be mounted automatically on /ephemeral0 but I found that this wasn't the case. You will need to use the "fdisk -l" command to find out the device name of the additional ephemeral storage. In my case, I found that the device was named&amp;nbsp;/dev/xvdj. However, there was no filesystem on it, and it wasn't mounted. So you'll need to execute commands like the following:&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;mkfs -t ext4 /dev/xvdj&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;mkdir /ephemeral0&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;echo "/dev/xvdj&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;/ephemeral0&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;ext4&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;defaults&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;1 2" &amp;gt;&amp;gt; /etc/fstab&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;mount /ephemeral0&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	The alternative storage is called EBS. The benefit is that it can participate in the Amazon backup solution, but the drawback is that it costs extra money. If you want to use EBS instead of ephemeral, you can create EBS Volumes using the Amazon Management Console and then &lt;a href="http://yoodey.com/how-attach-and-mount-ebs-volume-ec2-instance-ubuntu-1010"&gt;attach them to your instance&lt;/a&gt;. Bear in mind that you'll still need to discover the device with "fdisk -l", put a filesystem on it, mount it, etc.&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&lt;h2&gt;
		Moving MySQL to the additional ephemeral storage&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
	In order to utilize the larger ephemeral storage for database files, I needed to move the MySQL data files from /var/lib/mysql to a filesystem mounted on /ephemeral0. I tried to follow the instructions in section 10.4.1 of the HREL documentation titled "&lt;a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-MySQL-Configuration_Examples.html"&gt;MySQL Changing Database Location&lt;/a&gt;" but&amp;nbsp;when I restarted mysqld via "service mysqld start" it reported FAILED, and the following was found in /var/log/mysqld.log:&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&lt;em&gt;110902 11:35:42 mysqld_safe Starting mysqld daemon with databases from /opt/var/mysql&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;em&gt;110902 11:35:42 [Warning] Can't create test file /opt/var/mysql/domU-12-31-39-09-AE-12.lower-test&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;em&gt;110902 11:35:42 [Warning] Can't create test file /opt/var/mysql/domU-12-31-39-09-AE-12.lower-test&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;em&gt;/usr/libexec/mysqld: Can't change dir to '/opt/var/mysql/' (Errcode: 13)&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;em&gt;110902 11:35:42 [ERROR] Aborting&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	The irony here is that section 10.4.1 is meant to show you how to avoid this error. &amp;nbsp;So I had to find a different approach, and found inspiration in the following articles:&lt;/div&gt;
&lt;ul&gt;
	&lt;li&gt;
		&lt;a href="http://uzyn.com/running-mysql-on-ec2-ephemeral-storage-while-maintaining-consistency"&gt;Running MySQL on EC2 ephemeral storage while maintaining consistency&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		&lt;a href="http://aws.amazon.com/articles/1663"&gt;Running MySQL on Amazon EC2 with EBS&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		&lt;a href="http://www.servercobra.com/building-a-web-server-on-amazons-ec2"&gt;Building a Web Server on Amazon's EC2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	The strategy I used was to copy the MySQL files to /ephemeral0, and then mount the ephemeral storage directory back to /var/lib/mysql&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&lt;strong&gt;Step 1&lt;/strong&gt;: Stop the MySQL server and copy the data files over to /ephemeral0:&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# service mysqld stop&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# cd /var/lib&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# tar cf - mysql/ --selinux | (cd /ephemeral0/var/lib; tar xvfp -)&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;em&gt;NOTE: It's really important to keep the --selinux switch so that the SELinux context for each file will be saved in the tarball. Also, it's really important to keep the "p" switch upon extraction, so that file permissions will be preserved.&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&lt;strong&gt;Step 2&lt;/strong&gt;: Determine the existing selinux settings and re-apply them on a similar var/lib folder structure on /ephemeral0:&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# ls -lZ / | grep var&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;em&gt;&lt;code&gt;drwxr-xr-x. root root system_u:object_r:var_t:s0 &amp;nbsp; &amp;nbsp; &amp;nbsp; var&lt;/code&gt;&lt;/em&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# chcon -u system_u -r object_r -t var_t /ephemeral0/var&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# ls -lZ /var | grep lib&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;drwxr-xr-x. root &amp;nbsp; root &amp;nbsp; system_u:object_r:var_lib_t:s0 &amp;nbsp; lib&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# chcon -u system_u -r object_r -t var_t /ephemeral0/var/lib&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# ls -lZ /var/lib | grep mysql&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;drwxr-xr-x. mysql &amp;nbsp; &amp;nbsp; mysql &amp;nbsp; &amp;nbsp;system_u:object_r:mysqld_db_t:s0 mysql&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&lt;strong&gt;Step 3&lt;/strong&gt;: Re-create the /var/lib/mysql mount point and preserve ownership/group/selinux settings:&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# cd /var/lib&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# mv mysql mysql.orig&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# mkdir mysql&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# chown mysql mysql&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# chgrp mysql mysql&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# chcon -u system_u -r object_r -t mysqld_db_t mysql&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&lt;strong&gt;Step 4&lt;/strong&gt;: Mount the directory that contains the MySQL data onto the /var/lib/mysql mount point and restart MySQL:&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# echo "/ephemeral0/var/lib/mysql /var/lib/mysql none bind bind" &amp;gt;&amp;gt; /etc/fstab&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# mount /var/lib/mysql&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;[root@server]# service mysqld start&lt;/code&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;code&gt;&amp;nbsp;&lt;/code&gt;&lt;/div&gt;
&lt;h2&gt;
	Conclusion&lt;/h2&gt;
&lt;p&gt;
	The benefit of using this approach is that I didn't have to change any of the settings in the /etc/my.cnf configuration file. Also, I didn't have to fight the selinux security context problem. This approach can also be used for mounting other folders like /opt in order to utilize ephemeral storage.&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2011-09-02T22:59:43Z</dc:date>
  </entry>
  <entry>
    <title>Fixing SunCertPathBuilderException caused by Maven downloading from self-signed repository</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/fixing-suncertpathbuilderexception-caused-by-maven-downloading-from-self-signed-repository" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/fixing-suncertpathbuilderexception-caused-by-maven-downloading-from-self-signed-repository</id>
    <updated>2011-10-17T22:28:06Z</updated>
    <published>2011-08-11T17:47:43Z</published>
    <summary type="html">&lt;p&gt;
	If you have a Maven repository running under https with a self-signed certificate, then building a Maven project can report the following error:&lt;/p&gt;
&lt;p&gt;
	Error transferring file: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target&lt;/p&gt;
&lt;p&gt;
	There was an Oracle blog posted by&amp;nbsp;Andreas Sterbenz back on&amp;nbsp;Oct 09, 2006 that helped me diagnose the problem, but that blog is no longer available. Thankfully &lt;a href="http://dreamingthings.blogspot.com/2006/12/no-more-unable-to-find-valid.html"&gt;Andreas' blog was re-posted here&lt;/a&gt;. For additional information, I found &lt;a href="http://www.chrissearle.org/node/260"&gt;another blog post&lt;/a&gt; that was helpful.&lt;/p&gt;
&lt;p&gt;
	Anyways, I fixed this problem by downloading and compiling the source for &lt;a href="http://code.google.com/p/java-use-examples/source/browse/trunk/src/com/aw/ad/util/InstallCert.java"&gt;InstallCert.java&lt;/a&gt; and running the following command:&lt;/p&gt;
&lt;p&gt;
	&lt;code&gt;java com.aw.ad.util.InstallCert myhostname.mydomain.com&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;
	This generated a file named&amp;nbsp;&lt;strong&gt;jssecacerts&lt;/strong&gt; in the current directory.&lt;/p&gt;
&lt;p&gt;
	On Windows/Linux, this file needs to be copied to the JAVA_HOME/jre/lib/security/ directory.&lt;/p&gt;
&lt;p&gt;
	On Mac needs to be copied to the JAVA_HOME/lib/security/ directory.&lt;/p&gt;
&lt;p&gt;
	After I did this,&amp;nbsp;Maven was able to download the artifacts from the self-signed repository.&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2011-08-11T17:47:43Z</dc:date>
  </entry>
  <entry>
    <title>Lightning fast portlet development with JRebel</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/lightning-fast-portlet-development-with-jrebel" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/lightning-fast-portlet-development-with-jrebel</id>
    <updated>2011-07-22T21:54:48Z</updated>
    <published>2011-07-22T21:11:27Z</published>
    <summary type="html">&lt;p&gt;
	Back in April of this year I had the opportunity to speak at the &lt;a href="http://www.con-fess.com/"&gt;CON-FESS&lt;/a&gt; conference in Vienna, Austria. One of the exhibitors there was &lt;a href="http://www.zeroturnaround.com"&gt;zeroturnaround.com&lt;/a&gt; and I had the privilege of sitting next to founder &lt;a href="http://www.zeroturnaround.com/about-us/"&gt;Jevgeni Kabanov&lt;/a&gt;&amp;nbsp;over dinner one night.&lt;/p&gt;
&lt;p&gt;
	Jevgeni described the benefits of &lt;a href="http://www.zeroturnaround.com/jrebel/"&gt;JRebel&lt;/a&gt;, a&amp;nbsp;JVM-plugin that makes it possible for Java developers to instantly see any code change made to an app without redeploying. Needless to say, redeploying WARs is part of the very fabric of a Liferay portlet developer's life, so I knew that I had to give this product a try with my next &lt;a href="http://www.icefaces.org"&gt;ICEFaces 2&lt;/a&gt; portlet with &lt;a href="http://www.portletfaces.org/projects/portletfaces-bridge"&gt;PortletFaces Bridge&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
	and &lt;strong&gt;to my utter amazement... IT WORKED!!!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
	Simply put, &lt;strong&gt;this product is a MUST HAVE for Liferay portlet developers&lt;/strong&gt;. I'm hooked! Over the past 6 years of portlet development, this product could have saved me COUNTLESS hours of development time waiting for redeploys.&lt;/p&gt;
&lt;p&gt;
	The &lt;a href="http://www.zeroturnaround.com/jrebel/documentation/"&gt;JRebel documentation&lt;/a&gt; is quite good, but here are some quick instructions for how to get started with JRebel and the Liferay+Tomcat bundle:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;
		&lt;a href="http://www.zeroturnaround.com/jrebel/current/"&gt;Download JRebel&lt;/a&gt; (30 day free trial)&lt;/li&gt;
	&lt;li&gt;
		Install JRebel to it's default location. For example, on the Mac: /Applications/ZeroTurnaround/JRebel&lt;/li&gt;
	&lt;li&gt;
		Set the REBEL_HOME environment variable. On the Mac, I find it's best to do this inside the&amp;nbsp;$HOME/.MacOSX/environment.plist file:
		&lt;pre&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&amp;gt;
&amp;lt;plist version="1.0"&amp;gt; &amp;lt;dict&amp;gt;
&amp;lt;key&amp;gt;REBEL_HOME&amp;lt;/key&amp;gt;
&amp;lt;string&amp;gt;/Applications/ZeroTurnaround/JRebel&amp;lt;/string&amp;gt;
&amp;lt;/dict&amp;gt;
&amp;lt;/plist&amp;gt;&lt;/pre&gt;
	&lt;/li&gt;
	&lt;li&gt;
		On Mac, add the following to the LIFERAY_HOME/tomcat/bin/setenv.sh script:
		&lt;pre&gt;
-javaagent:$REBEL_HOME/jrebel.jar&lt;/pre&gt;
	&lt;/li&gt;
	&lt;li&gt;
		On Windows, add the following to the LIFERAY_HOME/tomcat/bin/setenv.bat file:
		&lt;pre&gt;
-javaagent:%REBEL_HOME%\jrebel.jar&lt;/pre&gt;
	&lt;/li&gt;
	&lt;li&gt;
		Create a &lt;a href="http://www.zeroturnaround.com/reference-manual/app.html#app-3.1"&gt;rebel.xml&lt;/a&gt; file that will be deployed in the runtime classpath of the WAR:Note that if you install the JRebel plugin for &lt;a href="http://www.zeroturnaround.com/reference-manual/ide.html#ide-2.2"&gt;Eclipse&lt;/a&gt;, &lt;a href="http://www.zeroturnaround.com/reference-manual/app.html#app-3.3"&gt;IntelliJ 8/9&lt;/a&gt;, &lt;a href="http://www.zeroturnaround.com/reference-manual/app.html#app-3.4"&gt;IntelliJ X&lt;/a&gt;, or &lt;a href="http://www.zeroturnaround.com/reference-manual/ide.html#ide-2.5"&gt;NetBeans&lt;/a&gt;) you can right click on the project and have the IDE generate the file. You can also generate the rebel.xml file with a &lt;a href="http://www.zeroturnaround.com/reference-manual/app.html#app-3.6"&gt;Maven&lt;/a&gt; goal.
		&lt;ul&gt;
			&lt;li&gt;
				&lt;strong&gt;Maven&lt;/strong&gt;: src/main/resources/rebel.xml&lt;/li&gt;
			&lt;li&gt;
				&lt;strong&gt;Liferay Plugins SDK&lt;/strong&gt;: docroot/WEB-INF/src/rebel.xml&lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;
		Start Tomcat with the liferay/tomcat/bin/startup.sh script (startup.bat on Windows)&lt;/li&gt;
	&lt;li&gt;
		Deploy the WAR to the Liferay /deploy folder&lt;/li&gt;
	&lt;li&gt;
		Make some Java code changes to your app and click Save in your IDE&lt;/li&gt;
	&lt;li&gt;
		Reload your browser, and voila! Instant changes! No redeploy!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2011-07-22T21:11:27Z</dc:date>
  </entry>
  <entry>
    <title>Working with JSF's &lt;f:convertDateTime /&gt; and java.util.Date</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/working-with-jsf-s-&lt;f:convertdatetime-&gt;-and-java-util-date" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/working-with-jsf-s-&lt;f:convertdatetime-&gt;-and-java-util-date</id>
    <updated>2010-07-30T18:00:04Z</updated>
    <published>2010-07-30T16:38:25Z</published>
    <summary type="html">&lt;p&gt;During a recent class I taught on ICEfaces, one of my students asked me why the &lt;ice:selectinputdate&gt;&lt;/ice:selectinputdate&gt; calendar was often one day off from what got posted back to the model managed-bean setter. &lt;br /&gt; &lt;br /&gt;&lt;strong&gt;For example&lt;/strong&gt;: &lt;br /&gt; &lt;code&gt;&lt;!-- Facelets XHTML markup: --&gt;// Facelets XHTML Markup:&lt;br /&gt;&amp;lt;ice:selectInputDate value=&amp;quot;#{modelManagedBean.dateOfBirth}&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;f:convertDateTime pattern=&amp;quot;MM/dd/yyyy&amp;quot; /&amp;gt;&lt;br /&gt;&lt;/code&gt;&lt;code&gt;&amp;lt;/ice:selectInputDate&amp;gt;&lt;br type="_moz" /&gt;&lt;/code&gt;&lt;code&gt;&lt;br /&gt;// Java Code&lt;br /&gt;import java.util.Date; &lt;br /&gt;&lt;/code&gt;&lt;code&gt; public class ModelManagedBean {&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;private Date dateOfBirth;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public Date getDateOfBirth()&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return dateOfBirth;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;public Date setDateOfBirth(Date dateOfBirth)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;SimpleDateFormat dateFormat = new SimpleDateFormat(&amp;quot;MM/dd/yyyy hh:mm z&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;// The value printed here during postback was often wrong by 1 day&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;System.out.println(&amp;quot;dateOfBirth=&amp;quot; + dateFormat.format(dateOfBirth));&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;this.dateOfBirth = dateOfBirth;&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;} &lt;/code&gt; &lt;br /&gt; &lt;br /&gt;Basically, the JSF&amp;nbsp;&lt;a href="https://javaserverfaces.dev.java.net/nonav/docs/2.0/javadocs/javax/faces/convert/DateTimeConverter.html"&gt;DateTimeConverter Javadoc&lt;/a&gt; states that if the timeZone attribute is not specified, then the default is GMT. But when you create an instance of java.text.SimpleDateFormat, the default TimeZone is equal to TimeZone.getDefault() which (for me) was EST.  So the solution I explained to my students was to make sure we were comparing apples-to-apples the whole way through, by using GMT for the SimpleDateFormat printing, like this: &lt;br /&gt;&lt;br /&gt; &lt;code&gt;dateFormat.setTimeZone(TimeZone.getTimeZone(&amp;quot;GMT&amp;quot;)); &lt;br /&gt;&lt;/code&gt; &lt;br /&gt; And of course, I think it's the recommended practice to run your application server JVM in GMT. That would eliminate the problem entirely. But when you're using Eclipse and Tomcat for development, that's typically not the case.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2010-07-30T16:38:25Z</dc:date>
  </entry>
  <entry>
    <title>JSF 2.0 Complete Reference, with JSF Portlet Appendix</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/jsf-2-0-complete-reference-with-jsf-portlet-appendix" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/jsf-2-0-complete-reference-with-jsf-portlet-appendix</id>
    <updated>2010-07-30T18:47:55Z</updated>
    <published>2010-02-03T10:43:46Z</published>
    <summary type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;table&gt;     &lt;tbody&gt;         &lt;tr&gt;             &lt;td&gt;&lt;a href="http://www.amazon.com/JavaServer-Faces-2-0-Complete-Reference/dp/0071625097/ref=sr_1_2?ie=UTF8&amp;amp;s=books&amp;amp;qid=1265194167&amp;amp;sr=8-2"&gt;&lt;img width="200" alt="JSF 2.0 Complete Reference with JSF Portlet Appendix" src="http://jsfcompref.appspot.com/faces/javax.faces.resource/jsfcompref-cover-front.jpg?ln=style" /&gt;&lt;/a&gt;&lt;/td&gt;             &lt;td&gt;&lt;p&gt;I'm pleased to announce the new &lt;a href="http://www.amazon.com/JavaServer-Faces-2-0-Complete-Reference/dp/0071625097/ref=sr_1_2?ie=UTF8&amp;amp;s=books&amp;amp;qid=1265194167&amp;amp;sr=8-2"&gt;JSF 2.0 Complete Reference&lt;/a&gt; book by Ed Burns and Chris Schalk, published by McGraw-Hill. During the planning stages, Ed asked me to be a contributing author and help bring the first edition of the book up-to-date with JSF 2.0, and also to write a&amp;nbsp;&lt;strong&gt;JSF Portlet Appendix&lt;/strong&gt;.&lt;/p&gt;             &lt;p&gt;As listed in the Table of Contents, Appendix A discusses the following Topics:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Overview of Portlet 1.0 and 2.0&lt;ul&gt;&lt;li&gt;Portlet Lifecycle&lt;/li&gt;&lt;li&gt;Portlet Modes&lt;/li&gt;&lt;li&gt;Portlet Window States&lt;/li&gt;&lt;li&gt;Portlet Preferences&lt;/li&gt;&lt;li&gt;Inter-Portlet Communication&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;JSF Portlet Development&lt;ul&gt;&lt;li&gt;JSF Portlet Bridges&lt;/li&gt;&lt;li&gt;JSF Portlet View Handlers&lt;/li&gt;&lt;li&gt;JSF ExernalContext and the Portlet API&lt;/li&gt;&lt;li&gt;JSF and Portlet Preferences&lt;/li&gt;&lt;li&gt;JSF and Inter-Portlet Communication&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;ICEfaces Portlet Development&lt;ul&gt;&lt;li&gt;ICEfaces Ajax with Partial Submit&lt;/li&gt;&lt;li&gt;ICEfaces Direct-to-DOM RenderKit&lt;/li&gt;&lt;li&gt;The ice:portlet Tag&lt;/li&gt;&lt;li&gt;ICEfaces 1.x Portlet Bridge&lt;/li&gt;&lt;li&gt;ICEfaces 1.x D2DFaceletViewHandler&lt;/li&gt;&lt;li&gt;ICEfaces 1.x and Portlet Window States&lt;/li&gt;&lt;li&gt;ICEfaces Portlets and Concurrent DOM Views&lt;/li&gt;&lt;li&gt;ICEfaces 1.x Extended Request Scope&lt;/li&gt;&lt;li&gt;ICEfaces Ajax Push and Inter-Portlet Communication&lt;/li&gt;&lt;li&gt;ICEfaces Themes and Portal Themes&lt;/li&gt;&lt;li&gt;ICEfaces Themes and Liferay Themes&lt;/li&gt;&lt;li&gt;ICEfaces Ajax Bridge and Liferay Portal&lt;/li&gt;&lt;li&gt;ICEfaces Portlets and Liferay Request Attributes&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;PortletFaces&lt;ul&gt;&lt;li&gt;Downloading PortletFaces&lt;/li&gt;&lt;li&gt;PortletFacesContext&lt;/li&gt;&lt;li&gt;PortletFaces Tags&lt;/li&gt;&lt;li&gt;PortletFaces and Portlet Preferences&lt;/li&gt;&lt;li&gt;PortletFaces and Expression Language Additions&lt;/li&gt;&lt;li&gt;PortletFaces and Localization&lt;/li&gt;&lt;li&gt;Liferay Language Portlet Integration&lt;/li&gt;&lt;li&gt;Improved Integration Between Liferay and ICEfaces 1.x&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;             &lt;p&gt;This week (Feb 2nd to Feb 5th) Ed Burns &amp;amp; Chris Schalk will be helping to &lt;a href="http://www.coderanch.com/t/481095/JSF/java/Welcome-Ed-Burns-Chris-Schalk"&gt;answer questions about the new book at JavaRanch.&lt;/a&gt; In addition, JavaRanch will be giving away a free copy of the book.&lt;/p&gt;&lt;p&gt;Finally I'd like to express my gratitude to &lt;a href="http://www.liferay.com"&gt;Liferay&lt;/a&gt;, &lt;a href="http://www.icesoft.com"&gt;ICEsoft&lt;/a&gt;, &lt;a href="http://www.mimacom.ch"&gt;Mimacom&lt;/a&gt;, and &lt;a href="http://www.tritonsvc.com"&gt;Triton&lt;/a&gt; for their generous support in making the JSF Portlet Appendix&amp;nbsp;possible.&lt;/p&gt;&lt;/td&gt;         &lt;/tr&gt;     &lt;/tbody&gt; &lt;/table&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2010-02-03T10:43:46Z</dc:date>
  </entry>
  <entry>
    <title>JSF 2.0 + ICEfaces 2.0 + Portlet 2.0 = The PortetFaces Bridge</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/jsf-2-0-icefaces-2-0-portlet-2-0-=-the-portetfaces-bridge" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/jsf-2-0-icefaces-2-0-portlet-2-0-=-the-portetfaces-bridge</id>
    <updated>2011-03-28T17:26:27Z</updated>
    <published>2010-01-27T17:47:52Z</published>
    <summary type="html">&lt;p&gt;&lt;strong&gt;UPDATE#1:&lt;/strong&gt; PortletFaces Bridge &lt;a href="http://www.icefaces.org/main/resources/upcoming-webinars.iface?webinar=478643680"&gt;webinar&lt;/a&gt; took place on Thursday, Feb 11 2010 AD. &lt;a href="http://www.liferay.com/c/document_library/get_file?uuid=e0e74148-245b-4bbd-88c5-132bd92944c1&amp;amp;groupId=11150"&gt;Click here to view the PDF slideshow&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;UPDATE#2&lt;/strong&gt;: The source code is at Alpha1 status and can be checked out from SVN here:&lt;/p&gt; &lt;ul&gt;     &lt;li&gt;&lt;a href="http://svn.portletfaces.org/svn/portletfaces/bridge/portletfaces-bridge-api/trunk/"&gt;http://svn.portletfaces.org/svn/portletfaces/bridge/portletfaces-bridge-api/trunk/&lt;/a&gt;&lt;/li&gt;     &lt;li&gt;&lt;a href="http://svn.portletfaces.org/svn/portletfaces/bridge/portletfaces-bridge-impl/trunk/"&gt;http://svn.portletfaces.org/svn/portletfaces/bridge/portletfaces-bridge-impl/trunk/&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;I'm working on a new project called the &lt;strong&gt;PortletFaces Bridge&lt;/strong&gt; which will enable the use of &lt;a href="http://www.javaserverfaces.org/"&gt;JSF 2.0&lt;/a&gt; within Portlet 2.0 compliant portals like Liferay 5.x. The bridge implements a subset of the features available in&amp;nbsp;&lt;a href="http://jcp.org/en/jsr/detail?id=329"&gt;JSR-329&lt;/a&gt;. Although the JSR-329 standard defines an API for a JSF 1.2 + Portlet 2.0 bridge, the PortletFaces Bridge is targeting JSF 2.0. Additionally, the bridge will facilitate usage of &lt;a href="http://wiki.icefaces.org/display/ICE/ICEfaces-2.0.0-Alpha2+Release+Notes"&gt;ICEfaces 2.0&lt;/a&gt; within Liferay Portal.&lt;/p&gt; &lt;p&gt;Project Status as of January 27, 2010 AD:&lt;/p&gt; &lt;ul&gt;     &lt;li&gt;&lt;meta charset="utf-8"&gt;I have a sample JSF 2.0 portlet developed that is using the new PortletFaces Bridge.                                   &lt;/meta&gt;&lt;/li&gt;     &lt;li&gt;&lt;meta charset="utf-8"&gt;HTTP GET of portal page: bridge runs the portlet RENDER_PHASE, which runs the JSF lifecycle+renderResponse and the portlet renders fine in the browser.                                   &lt;/meta&gt;&lt;/li&gt;     &lt;li&gt;&lt;meta charset="utf-8"&gt;HTTP POST after clicking h:commandButton: bridge runs the portlet ACTION_PHASE, which runs the JSF lifecycle. It then runs the portlet RENDER_PHASE, which runs the JSF renderResponse and the portlet renders fine in the browser.                                   &lt;/meta&gt;&lt;/li&gt;     &lt;li&gt;&lt;meta charset="utf-8"&gt;RESOURCES: When using the new JSF 2.0 &amp;quot;resource&amp;quot; mechanism (like for downloading the &amp;quot;jsf.js&amp;quot; JavaScript file), the bridge correctly invokes the portlet RESOURCE_PHASE, which invokes the JSF 2.0 ResourceHandler and the contents of the requested resource are correctly delivered back to the browser.                                   &lt;/meta&gt;&lt;/li&gt;     &lt;li&gt;&lt;meta charset="utf-8"&gt;AJAX: After tabbing-out of a field, the JSF 2.0 &amp;quot;jsf.js&amp;quot; JavaScript code correctly invokes the portlet RESOURCE_PHASE, which runs the JSF lifecycle+renderResponse, and correctly applies the DOM updates in the browser. Currently it uses the new JSF 2.0 &amp;lt;f:ajax /&amp;gt; tag to do Ajax requests. BTW I had to fix a problem in Mojarra to make this work -- I'm in contact with the Mojarra team and they're working on fixing it for the upcoming 2.0.3 release.                                   &lt;/meta&gt;&lt;/li&gt;     &lt;li&gt;&lt;meta charset="utf-8"&gt;What's left: There's a bunch of little things -- loose ends that need to be coded up. Stuff like:     &lt;ul&gt;         &lt;li&gt;Testing of ICEfaces 2.0 WITHOUT the &amp;lt;f:ajax /&amp;gt; tag&lt;/li&gt;         &lt;li&gt;Testing of ICEfaces 2.0 components (compatibility components)&lt;/li&gt;         &lt;li&gt;Testing of ICEfaces 2.0 Ajax Push&lt;/li&gt;         &lt;li&gt;After navigation-rules fire, need to compute the next JSF viewId to render&lt;/li&gt;         &lt;li&gt;Detecting portlet mode changes (VIEW MODE, EDIT MODE, HELP MODE)&lt;/li&gt;     &lt;/ul&gt;          &lt;/meta&gt;&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;The goal is to have an Alpha version ready for use by the time the webinar happens on Thursday, Feb 11 2010 AD. The bridge will be be an open source project and be available for download from the &lt;a href="http://www.portletfaces.org"&gt;http://www.portletfaces.org&lt;/a&gt; website.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2010-01-27T17:47:52Z</dc:date>
  </entry>
  <entry>
    <title>Speaking at JSF Summit: Social Networking with ICEfaces and Liferay</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/speaking-at-jsf-summit:-social-networking-with-icefaces-and-liferay" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/speaking-at-jsf-summit:-social-networking-with-icefaces-and-liferay</id>
    <updated>2009-11-18T17:29:41Z</updated>
    <published>2009-11-18T17:16:03Z</published>
    <summary type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;table&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td width="145" valign="top"&gt;&lt;a href="http://www.jsfsummit.com/conference/orlando/2009/12/session?id=16091"&gt;&lt;img width="125" height="125" alt="" src="http://cdn.www.liferay.com/image/image_gallery?uuid=23e99b02-5713-4300-9abe-31fa09a59fab&amp;amp;groupId=11150&amp;amp;t=1258564478583" /&gt;&lt;/a&gt;&lt;/td&gt;
            &lt;td valign="top"&gt;
            &lt;p&gt;I'll be speaking at &lt;a href="http://www.jsfsummit.com/conference/orlando/2009/12/session?id=16091"&gt;JSF Summit 2009&lt;/a&gt;.&lt;/p&gt;
            &lt;p&gt;The event is being held from 12/1 - 12/4&lt;/p&gt;
            &lt;p&gt;&lt;strong&gt;Location&lt;/strong&gt;:&lt;br /&gt;
            Loews Portofino Hotel @ Universal Orlando &lt;br /&gt;
            5601 Universal Boulevard &lt;br /&gt;
            Orlando, FL 32819&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td colspan="2"&gt;
            &lt;p&gt;&amp;nbsp;&lt;/p&gt;
            &lt;h3&gt;Session Title:&lt;/h3&gt;
            &lt;p&gt;&lt;a href="http://www.jsfsummit.com/conference/orlando/2009/12/session?id=16091"&gt;Social Networking with ICEfaces and Liferay&lt;/a&gt;&lt;/p&gt;
            &lt;h3&gt;Session Abstract:&lt;/h3&gt;
            &lt;p&gt;This talk will demonstrate how easy it is to develop social networking portlets with ICEfaces and Liferay. Attendees will learn the fundamental techniques through code walkthroughs of ICE Friends and ICE Chat portlets, leveraging Facelets composite components and real-time status updates via Ajax Push. &lt;br /&gt;
            &lt;br /&gt;
            Social networking is a natural addition to the portal, already a meeting place for applications. Diverse systems and users can be brought together for web-based communication and collaboration. When introduced to Ajax Push, portlets provide real-time communication features such as presence, chat, and new forms of application-specific interaction. Attendees will also learn about PortletFaces, a new open source project that enables a more JSF-centric approach to building portlets that use vendor-specific features of Liferay Portal.&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2009-11-18T17:16:03Z</dc:date>
  </entry>
  <entry>
    <title>PortletFaces Webinar</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/portletfaces-webinar" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/portletfaces-webinar</id>
    <updated>2009-10-27T18:30:37Z</updated>
    <published>2009-10-27T17:03:03Z</published>
    <summary type="html">&lt;p&gt;&lt;img width="500" height="171" src="http://edorasframework.org/image/image_gallery?uuid=0de70b13-4671-4f68-adb6-ccf1c31f2692&amp;amp;groupId=10250&amp;amp;t=1253892212161" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;I'm pleased to announce that the PortletFaces project has now been formally established and can be found here: &lt;a href="http://www.portletfaces.org"&gt;http://www.portletfaces.org&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;An ICEsoft+Mimacom &lt;strong&gt;webinar&lt;/strong&gt; has been scheduled for Thursday October 29, 2009:&lt;/p&gt;
&lt;p&gt;4PM - 5PM CET&lt;br /&gt;
11AM - 12PM&amp;nbsp;EDT&lt;br /&gt;
8AM - 9AM PDT&lt;/p&gt;
&lt;p&gt;Here's the registration link: &lt;a href="https://www1.gotomeeting.com/register/741441337"&gt;https://www1.gotomeeting.com/register/741441337&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I'll be conducting the webinar along with Micha Kiener of Mimacom, sponsor of the Edoras Framework.&lt;/p&gt;
&lt;p&gt;The goal the PortletFaces project is to make it easier to develop JSF portlets that run within Liferay Portal. The project contains a wealth of features that expose the standard features of the Portlet 2.0 API and vendor-specific features of Liferay in a way that is natural to JSF development. It also provides improved integration between Liferay and ICEfaces 1.x portlets.&lt;/p&gt;
&lt;p&gt;The beginnings of PortletFaces can be traced back to a &lt;a href="http://www.liferay.com/web/guest/community/forums/-/message_boards/message/114404"&gt;forum post made by community member Joel Kozikowski&lt;/a&gt; back in May of 2007. Joel donated his code to Liferay and we began to work on the project together under Liferay incubation. Since then, PortletFaces has been adopted by Mimacom AG and is a sub-project of the edoras framework.&lt;/p&gt;
&lt;p&gt;I'd like to personally thank Joel and the other contributors for their valuable additions to PortletFaces:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Micha Kiener&lt;/li&gt;
    &lt;li&gt;Atul Patel&lt;/li&gt;
    &lt;li&gt;Ed Shin&lt;/li&gt;
    &lt;li&gt;Stefan Niederhauser&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also my personal thanks to &lt;a href="http://www.liferay.com"&gt;Liferay&lt;/a&gt; for sponsoring PortletFaces during incubation, &lt;a href="http://www.icefaces.org"&gt;ICEsoft&lt;/a&gt; for all the terrific support, and thanks to &lt;a href="http://www.mimacom.ch"&gt;Mimacom&lt;/a&gt; for adopting the project.&lt;/p&gt;
&lt;p&gt;Finally, I'd like to thank &lt;a href="http://www.tritonsvc.com"&gt;Triton&lt;/a&gt;'s Steve Groninga for coming up with the PortletFaces project logo.&lt;/p&gt;
&lt;p&gt;Documentation for PortletFaces can be found here: &lt;a href="http://www.portletfaces.org/documentation"&gt;http://www.portletfaces.org/documentation&lt;/a&gt;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2009-10-27T17:03:03Z</dc:date>
  </entry>
  <entry>
    <title>JSF 2.0 Test Drive Part 2: Developing a Website with Facelets Templating</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/jsf-2-0-test-drive-part-2:-developing-a-website-with-facelets-templating" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/jsf-2-0-test-drive-part-2:-developing-a-website-with-facelets-templating</id>
    <updated>2010-12-20T19:40:40Z</updated>
    <published>2009-10-02T03:44:02Z</published>
    <summary type="html">&lt;p&gt;As part of my work on &lt;a href="http://jcp.org/en/jsr/detail?id=314"&gt;JSR 314 (JSF 2.0)&lt;/a&gt; I've been reviewing the specification, Javadocs, and tag library docs for accuracy. One way I&amp;nbsp;do this is to make examples that test drive what the documentation says JSF&amp;nbsp;2.0 will do.&lt;/p&gt; &lt;p&gt;In &lt;a href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/jsf-2-0-test-drive-part-1%3A-developing-a-facelet-composite-component"&gt;Part 1&lt;/a&gt; of this series, I showed how to develop an Ajaxified JSF 2.0 Facelet Composite Component.&lt;/p&gt; &lt;p&gt;Now here's Part 2 of my JSF 2.0 Test Drive... &lt;strong&gt;Developing a Website with Facelets Templating&lt;br /&gt; &lt;/strong&gt;&lt;/p&gt; &lt;h3&gt;Facelets Templating&lt;/h3&gt; &lt;p&gt;Templating -- what's that? Well templating refers to a technology that you would use to control the layout and content of a website. It's kind of like Liferay Portal's &amp;quot;Layout Template&amp;quot; feature that lets you control how portlets are arranged on the portal page.&lt;/p&gt; &lt;p&gt;The premiere view-handler in JSF&amp;nbsp;2.0 is Facelets, which provides a powerful templating engine designed especially for JSF. Websites typically have a layout of sections that is common for all pages:&amp;nbsp;header, navigation, main content, and footer. That's where Facelets Templating comes in to save the day.&lt;/p&gt; &lt;h3&gt;Downloadable Source Code&lt;/h3&gt; &lt;p&gt;The Maven 2 project source code is licensed under the MPL 1.1 and is available at the edoras framework SVN repo:&lt;/p&gt; &lt;p&gt;&lt;a href="http://svn.portletfaces.org/svn/portletfaces/legacy/examples/trunk/webapps/org.edorasframework.example.facelet.template.jsf.2.0/"&gt;http://svn.portletfaces.org/svn/portletfaces/legacy/examples/trunk/webapps/org.edorasframework.example.facelet.template.jsf.2.0/&lt;/a&gt;&lt;/p&gt; &lt;h3&gt;Home Page Screen Shot&lt;/h3&gt; &lt;p&gt;Here is a screen shot of the &lt;strong&gt;home page&lt;/strong&gt; for the website:&lt;/p&gt; &lt;p&gt;&lt;img width="556" height="200" alt="" src="http://cdn.www.liferay.com/image/image_gallery?uuid=7653a374-f71a-474e-a390-96e66c6cf7d3&amp;amp;groupId=11150&amp;amp;t=1254455573083" /&gt;&lt;/p&gt; &lt;p&gt;The &amp;quot;Welcome Our Company Website&amp;quot; light-gray rectangle at the top is the &amp;quot;&lt;strong&gt;header&lt;/strong&gt;&amp;quot;&amp;nbsp;of the website. This is kind of like a banner that is to appear at the top of every web page in the site. It typically never changes.&lt;/p&gt; &lt;p&gt;The Home, Products, and Contact Us links are part of the &amp;quot;&lt;strong&gt;navigation&lt;/strong&gt;&amp;quot; for the site. The links typically change a little from page to page in a real world site.&lt;/p&gt; &lt;p&gt;The &amp;quot;Welcome to the HOME&amp;nbsp;page&amp;quot;  dark-gray rectangle on the right is the &amp;quot;&lt;strong&gt;main&lt;/strong&gt;&amp;quot; content for each page. This is the content in this part typically changes quite a bit for each page.&lt;/p&gt; &lt;p&gt;The &amp;quot;Copyright&amp;quot; light-gray rectangle on the bottom is the &amp;quot;&lt;strong&gt;footer&lt;/strong&gt;&amp;quot; for the website. Like the header, it typically never changes.&lt;/p&gt; &lt;h3&gt;Template Source Markup:&amp;nbsp;template.xhtml&lt;/h3&gt; &lt;p&gt;Here is the markup for the template. It's basically a Facelets f:view that specifies an h:panelGroup (renders a &amp;lt;div&amp;gt; layer) for the header, and another for the footer. Note that those sections use the Facelets ui:include tag in order to insert the contents of the header and footer info, which lives in separate XHTML files. In the middle is an h:panelGrid, which renders a two-column HTML &amp;lt;table&amp;gt;. Note the Facelets ui:insert tags -- they are kind of like markers that indicate that something will be inserted at runtime. More on that when we look at the ui:define tags in the Home page. Also, note that the Facelets ui:debug tag is specified in the template -- that's kind of a best practice for helping JSF developers debug the server-side state of things.&lt;/p&gt; &lt;pre&gt;
&amp;lt;f:view xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xmlns:f=&amp;quot;http://java.sun.com/jsf/core&amp;quot;
  xmlns:h=&amp;quot;http://java.sun.com/jsf/html&amp;quot; xmlns:ui=&amp;quot;http://java.sun.com/jsf/facelets&amp;quot;
  xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
  xsi:schemaLocation=&amp;quot;http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd&amp;quot;&amp;gt;

  &amp;lt;!-- Enables CTRL+SHIFT+D for activating Facelets debug window --&amp;gt;
  &amp;lt;ui:debug /&amp;gt;

  &amp;lt;html&amp;gt;
  &amp;lt;h:head&amp;gt;
    &amp;lt;ui:insert name=&amp;quot;htmlHead&amp;quot; /&amp;gt;
    &amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;css/template.css&amp;quot; /&amp;gt;
  &amp;lt;/h:head&amp;gt;
  &amp;lt;h:body&amp;gt;
    &amp;lt;h:panelGroup layout=&amp;quot;block&amp;quot; styleClass=&amp;quot;header&amp;quot;&amp;gt;
      &amp;lt;ui:include src=&amp;quot;/WEB-INF/includes/header.xhtml&amp;quot; /&amp;gt;
    &amp;lt;/h:panelGroup&amp;gt;
    &amp;lt;h:panelGrid columns=&amp;quot;2&amp;quot; columnClasses=&amp;quot;nav-col, main-col&amp;quot; styleClass=&amp;quot;middle-table&amp;quot;&amp;gt;
      &amp;lt;h:panelGroup layout=&amp;quot;block&amp;quot;&amp;gt;
        &amp;lt;h:form&amp;gt;
          &amp;lt;ui:insert name=&amp;quot;navigation&amp;quot; /&amp;gt;
        &amp;lt;/h:form&amp;gt;
      &amp;lt;/h:panelGroup&amp;gt;
      &amp;lt;h:panelGroup layout=&amp;quot;block&amp;quot;&amp;gt;
        &amp;lt;ui:insert name=&amp;quot;main&amp;quot; /&amp;gt;
      &amp;lt;/h:panelGroup&amp;gt;
    &amp;lt;/h:panelGrid&amp;gt;
    &amp;lt;h:panelGroup layout=&amp;quot;block&amp;quot; styleClass=&amp;quot;footer&amp;quot;&amp;gt;
      &amp;lt;ui:include src=&amp;quot;/WEB-INF/includes/footer.xhtml&amp;quot; /&amp;gt;
    &amp;lt;/h:panelGroup&amp;gt;
  &amp;lt;/h:body&amp;gt;
  &amp;lt;/html&amp;gt;
&amp;lt;/f:view&amp;gt;
&lt;/pre&gt; &lt;h3&gt;Home Page Source Markup: home.xhtml&lt;/h3&gt; &lt;p&gt;Here's the markup for the home page. Note that it's not a Facelets f:view at all -- instead its a ui:composition that specifies template.xhtml as the Facelet template to be used for rendering. The main thing to point out here is that the ui:define tag &amp;quot;defines&amp;quot; the content that is to be inserted into the template via the corresponding ui:insert tag found in the template.&lt;/p&gt; &lt;pre&gt;
&amp;lt;ui:composition xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xmlns:h=&amp;quot;http://java.sun.com/jsf/html&amp;quot;
  xmlns:f=&amp;quot;http://java.sun.com/jsf/core&amp;quot; xmlns:ui=&amp;quot;http://java.sun.com/jsf/facelets&amp;quot;
  xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
  xsi:schemaLocation=&amp;quot;http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd&amp;quot;
  template=&amp;quot;/WEB-INF/includes/template.xhtml&amp;quot;&amp;gt;

  &amp;lt;ui:define name=&amp;quot;htmlHead&amp;quot;&amp;gt;
    &amp;lt;meta name=&amp;quot;description&amp;quot; content=&amp;quot;Our Company Home Page&amp;quot; /&amp;gt;
    &amp;lt;title&amp;gt;Our Company - Home&amp;lt;/title&amp;gt;
  &amp;lt;/ui:define&amp;gt;

  &amp;lt;ui:define name=&amp;quot;navigation&amp;quot;&amp;gt;
    &amp;lt;h:outputText styleClass=&amp;quot;selected&amp;quot; value=&amp;quot;Home&amp;quot; /&amp;gt;
    &amp;lt;h:commandLink action=&amp;quot;products&amp;quot; value=&amp;quot;Products&amp;quot; /&amp;gt;
    &amp;lt;h:commandLink action=&amp;quot;contact-us&amp;quot; value=&amp;quot;Contact Us&amp;quot; /&amp;gt;
  &amp;lt;/ui:define&amp;gt;

  &amp;lt;ui:define name=&amp;quot;main&amp;quot;&amp;gt;
    &amp;lt;h:outputText value=&amp;quot;Welcome to the HOME page.&amp;quot; /&amp;gt;
  &amp;lt;/ui:define&amp;gt;

&amp;lt;/ui:composition&amp;gt;
&lt;/pre&gt; &lt;p&gt;The remainer of the files (header, footer, products page, contact-us page) are the SVN repos.&lt;/p&gt; &lt;p&gt;Again, hope you enjoyed seeing JSF 2.0 in action! Good stuff ahead!&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2009-10-02T03:44:02Z</dc:date>
  </entry>
  <entry>
    <title>JSF 2.0 Test Drive Part 1: Developing a Facelet Composite Component</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/jsf-2-0-test-drive-part-1:-developing-a-facelet-composite-component" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/jsf-2-0-test-drive-part-1:-developing-a-facelet-composite-component</id>
    <updated>2010-12-20T19:38:40Z</updated>
    <published>2009-10-02T02:30:29Z</published>
    <summary type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;As part of my work on &lt;a href="http://jcp.org/en/jsr/detail?id=314"&gt;JSR 314 (JSF 2.0)&lt;/a&gt; I've been reviewing the specification, Javadocs, and tag library docs for accuracy. One way I&amp;nbsp;do this is to make examples that test drive what the documentation says JSF&amp;nbsp;2.0 will do.&lt;/p&gt; &lt;p&gt;To that end, here's Part 1 of my JSF 2.0 Test Drive... &lt;strong&gt;Developing a Facelet Composite Component&lt;/strong&gt;&lt;/p&gt; &lt;h3&gt;Composite Component Tag&lt;/h3&gt; &lt;pre&gt;
  &amp;lt;testcc:inputColor /&amp;gt;
&lt;/pre&gt; &lt;h3&gt;Description&lt;/h3&gt; &lt;p&gt;An Ajaxified JSF 2.0 Facelet Composite Component that lets you choose an RGB color.&lt;/p&gt; &lt;h3&gt;Downloadable Source Code&lt;/h3&gt; &lt;p&gt;The Maven 2 project source code is licensed under the MPL 1.1 and is available at the edoras framework SVN repo:&lt;/p&gt; &lt;p&gt;&lt;a href="http://svn.portletfaces.org/svn/portletfaces/legacy/examples/trunk/webapps/org.edorasframework.example.facelet.cc.jsf.2.0/"&gt;http://svn.portletfaces.org/svn/portletfaces/legacy/examples/trunk/webapps/org.edorasframework.example.facelet.cc.jsf.2.0/&lt;/a&gt;&lt;/p&gt; &lt;h3&gt;Screen Shot&lt;/h3&gt; &lt;p&gt;&amp;nbsp;&lt;img width="413" height="414" alt="" src="http://cdn.www.liferay.com/image/image_gallery?uuid=6eb50b23-a454-4ff9-92f9-45425e20ba67&amp;amp;groupId=11150&amp;amp;t=1254451762841" /&gt;&lt;/p&gt; &lt;h3&gt;JSF 2.0 Terminology&lt;/h3&gt; &lt;p&gt;In order to understand some of the terms used in the example, let's talk about some new JSF 2.0 Facelet terminology found in the documentation:&lt;/p&gt; &lt;table&gt;     &lt;tbody&gt;         &lt;tr&gt;             &lt;td&gt;&lt;strong&gt;Composite Component:&lt;/strong&gt;&lt;/td&gt;             &lt;td&gt;Refers to an XHTML file that contains a piece of reusable markup that is encapsulated by the ui:component tag&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;             &lt;td&gt;&lt;strong&gt;Composite Component Author:&lt;/strong&gt;&lt;/td&gt;             &lt;td&gt;Refers to the person that develops the &lt;em&gt;composite component&lt;/em&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;             &lt;td&gt;&lt;strong&gt;Composite Component Tag:&lt;/strong&gt;&lt;/td&gt;             &lt;td&gt;Refers to a tag like &amp;lt;testcc:inputColor /&amp;gt; that lets folks create instances of the &lt;em&gt;composite component&lt;/em&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;             &lt;td&gt;&lt;strong&gt;Using Page:&lt;/strong&gt;&lt;/td&gt;             &lt;td&gt;Refers to the Facelet XHTML f:view that contains the &lt;em&gt;composite component tag&lt;/em&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;             &lt;td&gt;&lt;strong&gt;Page Author:&lt;/strong&gt;&lt;/td&gt;             &lt;td&gt;Refers to the person that that creates an instance of the composite component on a &lt;em&gt;using page&lt;/em&gt;.&lt;/td&gt;         &lt;/tr&gt;     &lt;/tbody&gt; &lt;/table&gt; &lt;h3&gt;Composite Component Source: inputColor.xhtml&lt;/h3&gt; &lt;p&gt;Here's the markup for the component itself. Note how JSF 2.0 now has a nice &lt;strong&gt;ui:interface&lt;/strong&gt; section for defining the usage contract for the &lt;em&gt;page author&lt;/em&gt; to abide by, and a &lt;strong&gt;ui:implementation&lt;/strong&gt; section for hiding the inner workings of the component itself (the reusable markup). Also note that I didn't have to write any Javascript to perform Ajax updates in the DOM -- JSF 2.0 has that built-in with the &lt;strong&gt;f:ajax&lt;/strong&gt; tag. The render attribute of f:ajax specifies a space-delimited list of &amp;quot;ids&amp;quot; that are to be re-rendered after the form is submitted via XmlHttpRequest().&lt;/p&gt; &lt;pre&gt;
&amp;lt;ui:component xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xmlns:c=&amp;quot;http://java.sun.com/jsp/jstl/core&amp;quot;
  xmlns:f=&amp;quot;http://java.sun.com/jsf/core&amp;quot; xmlns:h=&amp;quot;http://java.sun.com/jsf/html&amp;quot;
  xmlns:ui=&amp;quot;http://java.sun.com/jsf/facelets&amp;quot; xmlns:cc=&amp;quot;http://java.sun.com/jsf/composite&amp;quot;
  xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
  xsi:schemaLocation=&amp;quot;http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd&amp;quot;&amp;gt;

  &amp;lt;cc:interface&amp;gt;
    &amp;lt;cc:attribute name=&amp;quot;value&amp;quot; required=&amp;quot;true&amp;quot; type=&amp;quot;org.edorasframework.example.Color&amp;quot;&amp;gt;
      &amp;lt;cc:attribute name=&amp;quot;red&amp;quot; required=&amp;quot;true&amp;quot; /&amp;gt;
      &amp;lt;cc:attribute name=&amp;quot;green&amp;quot; required=&amp;quot;true&amp;quot; /&amp;gt;
      &amp;lt;cc:attribute name=&amp;quot;blue&amp;quot; required=&amp;quot;true&amp;quot; /&amp;gt;
    &amp;lt;/cc:attribute&amp;gt;
    &amp;lt;cc:actionSource name=&amp;quot;colorPalette&amp;quot; targets=&amp;quot;redSelector greenSelector blueSelector&amp;quot; /&amp;gt;
    &amp;lt;cc:editableValueHolder name=&amp;quot;colorFields&amp;quot; targets=&amp;quot;redInputText greenInputText blueInputText&amp;quot; /&amp;gt;
    &amp;lt;cc:facet name=&amp;quot;header&amp;quot; required=&amp;quot;true&amp;quot; /&amp;gt;
  &amp;lt;/cc:interface&amp;gt;

  &amp;lt;cc:implementation&amp;gt;
    &amp;lt;cc:renderFacet name=&amp;quot;header&amp;quot; /&amp;gt;
    &amp;lt;f:ajax render=&amp;quot;preview kids&amp;quot;&amp;gt;
      &amp;lt;h:panelGrid columns=&amp;quot;2&amp;quot;&amp;gt;
        &amp;lt;h:outputLabel value=&amp;quot;R:&amp;quot; /&amp;gt;
        &amp;lt;h:inputText id=&amp;quot;redInputText&amp;quot; value=&amp;quot;#{cc.attrs.value.red}&amp;quot;&amp;gt;
          &amp;lt;f:validateLongRange minimum=&amp;quot;0&amp;quot; maximum=&amp;quot;255&amp;quot; /&amp;gt;
        &amp;lt;/h:inputText&amp;gt;
        &amp;lt;h:outputLabel value=&amp;quot;G:&amp;quot; /&amp;gt;
        &amp;lt;h:inputText id=&amp;quot;greenInputText&amp;quot; value=&amp;quot;#{cc.attrs.value.green}&amp;quot;&amp;gt;
          &amp;lt;f:validateLongRange minimum=&amp;quot;0&amp;quot; maximum=&amp;quot;255&amp;quot; /&amp;gt;
        &amp;lt;/h:inputText&amp;gt;
        &amp;lt;h:outputLabel value=&amp;quot;B:&amp;quot; /&amp;gt;
        &amp;lt;h:inputText id=&amp;quot;blueInputText&amp;quot; value=&amp;quot;#{cc.attrs.value.blue}&amp;quot;&amp;gt;
          &amp;lt;f:validateLongRange minimum=&amp;quot;0&amp;quot; maximum=&amp;quot;255&amp;quot; /&amp;gt;
        &amp;lt;/h:inputText&amp;gt;
      &amp;lt;/h:panelGrid&amp;gt;
    &amp;lt;/f:ajax&amp;gt;
    &amp;lt;h:outputText value=&amp;quot;Color Preview: &amp;quot; /&amp;gt;
    &amp;lt;c:set value=&amp;quot;#{cc.attrs.value.red}&amp;quot; var=&amp;quot;red&amp;quot; /&amp;gt;
    &amp;lt;c:set value=&amp;quot;#{cc.attrs.value.green}&amp;quot; var=&amp;quot;green&amp;quot; /&amp;gt;
    &amp;lt;c:set value=&amp;quot;#{cc.attrs.value.blue}&amp;quot; var=&amp;quot;blue&amp;quot; /&amp;gt;
    &amp;lt;c:set value=&amp;quot;#{red},#{green},#{blue}&amp;quot; var=&amp;quot;rgb&amp;quot; /&amp;gt;
    &amp;lt;h:outputText id=&amp;quot;preview&amp;quot; value=&amp;quot; &amp;quot; style=&amp;quot;border: 1px solid; padding: 1px 10px; background-color: rgb(#{rgb});&amp;quot; /&amp;gt;
    &amp;lt;f:ajax render=&amp;quot;redInputText greenInputText blueInputText preview kids&amp;quot;&amp;gt;
      &amp;lt;h:panelGrid border=&amp;quot;1&amp;quot; columns=&amp;quot;3&amp;quot;&amp;gt;
        &amp;lt;f:facet name=&amp;quot;header&amp;quot;&amp;gt;
          &amp;lt;h:outputText value=&amp;quot;Color Palette&amp;quot; /&amp;gt;
        &amp;lt;/f:facet&amp;gt;
        &amp;lt;h:commandLink id=&amp;quot;redSelector&amp;quot; value=&amp;quot;Red&amp;quot;&amp;gt;
          &amp;lt;f:setPropertyActionListener target=&amp;quot;#{cc.attrs.value.red}&amp;quot; value=&amp;quot;255&amp;quot; /&amp;gt;
          &amp;lt;f:setPropertyActionListener target=&amp;quot;#{cc.attrs.value.green}&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;
          &amp;lt;f:setPropertyActionListener target=&amp;quot;#{cc.attrs.value.blue}&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;
        &amp;lt;/h:commandLink&amp;gt;
        &amp;lt;h:commandLink id=&amp;quot;greenSelector&amp;quot; value=&amp;quot;Green&amp;quot;&amp;gt;
          &amp;lt;f:setPropertyActionListener target=&amp;quot;#{cc.attrs.value.red}&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;
          &amp;lt;f:setPropertyActionListener target=&amp;quot;#{cc.attrs.value.green}&amp;quot; value=&amp;quot;255&amp;quot; /&amp;gt;
          &amp;lt;f:setPropertyActionListener target=&amp;quot;#{cc.attrs.value.blue}&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;
        &amp;lt;/h:commandLink&amp;gt;
        &amp;lt;h:commandLink id=&amp;quot;blueSelector&amp;quot; value=&amp;quot;Blue&amp;quot;&amp;gt;
          &amp;lt;f:setPropertyActionListener target=&amp;quot;#{cc.attrs.value.red}&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;
          &amp;lt;f:setPropertyActionListener target=&amp;quot;#{cc.attrs.value.green}&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;
          &amp;lt;f:setPropertyActionListener target=&amp;quot;#{cc.attrs.value.blue}&amp;quot; value=&amp;quot;255&amp;quot; /&amp;gt;
        &amp;lt;/h:commandLink&amp;gt;
      &amp;lt;/h:panelGrid&amp;gt;
    &amp;lt;/f:ajax&amp;gt;
    &amp;lt;br /&amp;gt;
    &amp;lt;h:panelGroup id=&amp;quot;kids&amp;quot;&amp;gt;
      &amp;lt;cc:insertChildren /&amp;gt;
    &amp;lt;/h:panelGroup&amp;gt;
  &amp;lt;/cc:implementation&amp;gt;

&amp;lt;/ui:component&amp;gt;
&lt;/pre&gt; &lt;h3&gt;Using&amp;nbsp;Page Source:&amp;nbsp;usingPage.xhtml&lt;/h3&gt; &lt;p&gt;Here's what the &lt;em&gt;using page&lt;/em&gt; looks like, and how it creates an instance of the composite component by using a &lt;em&gt;composite component tag&lt;/em&gt;. Note that with JSF 2.0, you can attach action-listeners and value-change-listeners to composite components. Additionally, you can specify children inside the composite component tag, provided that the composite component author uses the &lt;strong&gt;ui:insertChildren&lt;/strong&gt; tag to place the children somewhere in the reusable markup. The testcc:inputColor tag shown below inserts an h:panelGrid as a child, which shows the &amp;quot;You Selected...&amp;quot; part to the user.&lt;/p&gt; &lt;pre&gt;
&amp;lt;f:view xmlns=&amp;quot;http://www.w3.org/1999/xhtml&amp;quot; xmlns:f=&amp;quot;http://java.sun.com/jsf/core&amp;quot;
  xmlns:h=&amp;quot;http://java.sun.com/jsf/html&amp;quot; xmlns:testcc=&amp;quot;http://java.sun.com/jsf/composite/testcc&amp;quot;
  xmlns:ui=&amp;quot;http://java.sun.com/jsf/facelets&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
  xsi:schemaLocation=&amp;quot;http://www.w3.org/1999/xhtml http://www.w3.org/2002/08/xhtml/xhtml1-transitional.xsd&amp;quot;&amp;gt;
  &amp;lt;h:head&amp;gt;
    &amp;lt;title&amp;gt;Using Page&amp;lt;/title&amp;gt;
  &amp;lt;/h:head&amp;gt;
  &amp;lt;h:body&amp;gt;
    &amp;lt;h:form&amp;gt;
      &amp;lt;h:messages /&amp;gt;
      &amp;lt;testcc:inputColor value=&amp;quot;#{modelManagedBean.color}&amp;quot;&amp;gt;

        &amp;lt;f:facet name=&amp;quot;header&amp;quot;&amp;gt;
          &amp;lt;h:outputText value=&amp;quot;Please choose a color&amp;quot; /&amp;gt;
        &amp;lt;/f:facet&amp;gt;

        &amp;lt;f:actionListener for=&amp;quot;colorPalette&amp;quot; type=&amp;quot;org.edorasframework.example.ColorActionListener&amp;quot; /&amp;gt;

        &amp;lt;f:valueChangeListener for=&amp;quot;colorFields&amp;quot; type=&amp;quot;org.edorasframework.example.ColorValueChangeListener&amp;quot; /&amp;gt;

        &amp;lt;!--
        The following h:panelGrid will be used by the cc:insertChildren tag in the
        cc:implementation section of the  testcc:inputColor composite component.
        --&amp;gt;
        &amp;lt;h:panelGrid columns=&amp;quot;2&amp;quot;&amp;gt;
          &amp;lt;f:facet name=&amp;quot;header&amp;quot;&amp;gt;
            &amp;lt;h:outputText value=&amp;quot;You Selected: &amp;quot; /&amp;gt;
          &amp;lt;/f:facet&amp;gt;
          &amp;lt;h:outputLabel value=&amp;quot;Red:&amp;quot; /&amp;gt;
          &amp;lt;h:outputText value=&amp;quot;#{modelManagedBean.color.red}&amp;quot; /&amp;gt;
          &amp;lt;h:outputLabel value=&amp;quot;Green:&amp;quot; /&amp;gt;
          &amp;lt;h:outputText value=&amp;quot;#{modelManagedBean.color.green}&amp;quot; /&amp;gt;
          &amp;lt;h:outputLabel value=&amp;quot;Blue:&amp;quot; /&amp;gt;
          &amp;lt;h:outputText value=&amp;quot;#{modelManagedBean.color.blue}&amp;quot; /&amp;gt;
        &amp;lt;/h:panelGrid&amp;gt;

      &amp;lt;/testcc:inputColor&amp;gt;
      &amp;lt;br /&amp;gt;
      &amp;lt;h:commandButton value=&amp;quot;Submit&amp;quot; /&amp;gt;
    &amp;lt;/h:form&amp;gt;
  &amp;lt;/h:body&amp;gt;
&amp;lt;/f:view&amp;gt;

&lt;/pre&gt; &lt;h3&gt;Composite Component Value POJO: Color.java&lt;/h3&gt; &lt;p&gt;Here is the POJO that is used to supply a value to the composite component:&lt;/p&gt; &lt;pre&gt;
package org.edorasframework.example;

import java.io.Serializable;

/**
 * This class provides a way of representing a color as an RGB triplet.
 *
 * @author  &amp;quot;Neil Griffin&amp;quot;
 */
public class Color implements Serializable {

  private static final long serialVersionUID = -3810147232196826614L;

  private int red;
  private int green;
  private int blue;

  public int getBlue() {
    return blue;
  }

  public int getGreen() {
    return green;
  }

  public int getRed() {
    return red;
  }

  public void setBlue(int blue) {
    this.blue = blue;
  }

  public void setGreen(int green) {
    this.green = green;
  }

  public void setRed(int red) {
    this.red = red;
  }

}
&lt;/pre&gt; &lt;p&gt;The remainer of the files (action listener, value change listener, model managed bean) are all available from the SVN repos.&lt;/p&gt; &lt;p&gt;Anyways, hope you enjoyed seeing JSF 2.0 in action! Good stuff ahead!&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2009-10-02T02:30:29Z</dc:date>
  </entry>
  <entry>
    <title>There's Gold in that Portal!</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/there-s-gold-in-that-portal!" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/there-s-gold-in-that-portal!</id>
    <updated>2009-10-05T00:55:23Z</updated>
    <published>2009-10-01T21:56:14Z</published>
    <summary type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;On a recent trip to Colorado I had the opportunity to go panning for gold in a stream and take a tour of a gold mine. There may be a lot of gold in the West Portal (shown below), but rest assured I'm still hooked on Liferay. Although I enjoyed my time out there, it is good to be back home in Sunny, FL.&lt;/p&gt; &lt;p&gt;&lt;img width="389" height="435" alt="" src="http://cdn.www.liferay.com/image/image_gallery?uuid=118deb9a-5cbd-4a3c-8b16-936091ab67a1&amp;amp;groupId=11150&amp;amp;t=1254434163169" /&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2009-10-01T21:56:14Z</dc:date>
  </entry>
  <entry>
    <title>Jazoon 2009 Conference Video: Like Peanut Butter &amp; Chocolate (or Ajax Meets Portals)</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/jazoon-2009-conference-video:-like-peanut-butter-&amp;-chocolate-or-ajax-meets-portals-" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/jazoon-2009-conference-video:-like-peanut-butter-&amp;-chocolate-or-ajax-meets-portals-</id>
    <updated>2010-04-02T15:08:03Z</updated>
    <published>2009-09-17T10:15:10Z</published>
    <summary type="html">&lt;p&gt;Here is the video recording of the Jazoon 2009 talk I was privileged to do with Micha Kiener of Mimacom:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Presentation Title:&lt;/strong&gt; Like Peanut Butter &amp;amp; Chocolate (or Ajax Meets Portals)&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Direct link&lt;/strong&gt;:&amp;nbsp;&lt;a href="http://www.parleys.com/#id=363&amp;amp;st=5&amp;amp;sl=38"&gt;http://www.parleys.com/#id=363&amp;amp;st=5&amp;amp;sl=38&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Description:&lt;/strong&gt; Discussion of how ICEfaces and Ajax Push can be used to perform Inter-Portlet-Communication (IPC) and also provides a rich Ajax-powered user experience.&lt;/p&gt; &lt;p&gt;&lt;object width="474" height="443"&gt; &lt;param name="movie" value="http://beta.parleys.com/share/parleysshare2.swf?pageId=363" /&gt; &lt;param name="allowFullScreen" value="true" /&gt; &lt;param name="pageId" value="363" /&gt;   &lt;embed src="http://beta.parleys.com/share/parleysshare2.swf?pageId=363" type="application/x-shockwave-flash" allowfullscreen="true" width="474" height="443"&gt;&lt;/embed&gt; &lt;/object&gt;&lt;/p&gt; &lt;p&gt;&lt;img alt="" src="http://www.liferay.com/html/themes/classic/images/arrows/01_up.png" /&gt; &lt;img alt="" src="http://www.liferay.com/html/themes/classic/images/arrows/01_up.png" /&gt; &lt;img alt="" src="http://www.liferay.com/html/themes/classic/images/arrows/01_up.png" /&gt; &lt;img alt="" src="http://www.liferay.com/html/themes/classic/images/arrows/01_up.png" /&gt;&lt;em&gt; &lt;strong&gt; You may need to click the &lt;span style="color: #00ff00;"&gt;triangle (play) button&lt;/span&gt; to get the movie to play.&lt;/strong&gt; &lt;/em&gt;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2009-09-17T10:15:10Z</dc:date>
  </entry>
  <entry>
    <title>Conference Talks: Social Networking Portlets with ICEfaces Ajax Push</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/conference-talks:-social-networking-portlets-with-icefaces-ajax-push" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/conference-talks:-social-networking-portlets-with-icefaces-ajax-push</id>
    <updated>2009-08-14T16:47:09Z</updated>
    <published>2009-05-19T21:39:10Z</published>
    <summary type="html">&lt;p&gt;I have the privilege of speaking about &lt;strong&gt;Social Networking Portlets with ICEfaces Ajax Push&lt;/strong&gt; at the following three conferences:&lt;/p&gt; &lt;table&gt;     &lt;tbody&gt; 	&lt;tr&gt;             &lt;td style="padding-left: 10px;"&gt;&lt;a href="http://www.jsfsummit.com/conference/orlando/2009/12/session?id=16091"&gt;&lt;img width="125" height="125" alt="I am speaking at JSF Summit 2009" src="http://www.nofluffjuststuff.com/images/2009/JSFSummit_125x125.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;             &lt;td style="padding-left: 10px; vertical-align: top;"&gt;&lt;p&gt;&lt;a href="http://www.jsfsummit.com/conference/orlando/2009/12/session?id=16091"&gt;JSF Summit&lt;/a&gt;&lt;/p&gt;             &lt;p&gt;Dec 1-4, 2009&lt;br /&gt;Orlando, FL&lt;/p&gt;&lt;/td&gt;         &lt;/tr&gt; 	&lt;tr&gt;             &lt;td style="padding-left: 10px;"&gt;&lt;a href="http://developers.sun.com/events/communityone/2009/west/"&gt;&lt;img width="170" height="93" alt="I am speaking at CommunityOne 2009" src="http://cdn.www.liferay.com/image/image_gallery?uuid=b7f4cd2c-0984-4481-b604-03b8bfcc97d1&amp;amp;groupId=11150&amp;amp;t=1242769296747" /&gt;&lt;/a&gt;&lt;/td&gt;             &lt;td style="padding-left: 10px; vertical-align: top;"&gt;&lt;p&gt;&lt;a href="http://developers.sun.com/events/communityone/2009/west/"&gt;CommunityOne West&lt;/a&gt;&lt;br /&gt;             Here I'll be co-speaking with &lt;a href="http://weblogs.java.net/blog/edburns/"&gt;Ed Burns&lt;/a&gt;, who is co-chairman of the &lt;a href="http://jcp.org/en/jsr/detail?id=314"&gt;JSR 314 (JSF 2.0)&amp;nbsp;Expert Group&lt;/a&gt;&lt;/p&gt;             &lt;p&gt;June 1-3, 2009&lt;br /&gt;             The Moscone Center&lt;br /&gt;             San Francisco&lt;br /&gt;             &lt;a href="http://maps.google.com/maps?f=q&amp;amp;source=s_q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=747+Howard+St,+San+Francisco,+CA+94103&amp;amp;sll=37.800222,-122.399368&amp;amp;sspn=0.03825,0.09819&amp;amp;ie=UTF8&amp;amp;t=h&amp;amp;z=16&amp;amp;iwloc=A"&gt;Map&lt;/a&gt;&lt;/p&gt;             &lt;p&gt;This is an open developer conference. Monday 6/1 is free!&lt;/p&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;             &lt;td&gt;&lt;a href="http://www.liferay.com/web/guest/news/events/ecuc2009"&gt;&lt;img width="410" height="93" alt="" src="http://cdn.www.liferay.com/image/image_gallery?uuid=f96990fa-7650-4f17-a3e8-330dca90e2f4&amp;amp;groupId=11150&amp;amp;t=1242774971188" /&gt;&lt;/a&gt;&lt;/td&gt;             &lt;td style="vertical-align: top;"&gt;&lt;p&gt;&lt;a href="http://www.liferay.com/web/guest/news/events/ecuc2009"&gt;Liferay East Coast User Conference&lt;/a&gt;&lt;/p&gt;             &lt;p&gt;May 21, 2009&lt;br /&gt;             Rivet Logic Corporation (Training Center)&lt;br /&gt;             1775 Wiehle Avenue, 3rd floor&lt;br /&gt;             Reston, VA 20190&lt;br /&gt;             &lt;a href="http://maps.google.com/maps?f=q&amp;amp;source=s_q&amp;amp;hl=en&amp;amp;geocode=&amp;amp;q=1775+Wiehle+Avenue,+Reston,+VA+20190&amp;amp;sll=37.0625,-95.677068&amp;amp;sspn=34.176059,79.101563&amp;amp;ie=UTF8&amp;amp;ll=38.954386,-77.334588&amp;amp;spn=0.008193,0.019312&amp;amp;z=16&amp;amp;iwloc=A"&gt;Map&lt;/a&gt;&lt;/p&gt;&lt;/td&gt; 	&lt;/tr&gt;     &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;The talks will focus on the power and elegance of Liferay + ICEfaces Ajax Push, and how these technologies can be used together to create Social Networking portlets with Liferay Portal.&lt;/p&gt; &lt;p&gt;Social networking is a natural addition to portals, already a meeting place for applications. Diverse systems and users can be brought together for web-based communication and collaboration.  When introduced to Ajax Push, Portlets can provide real-timecommunication features, such as presence, chat, and new forms of application-specific interaction.&lt;/p&gt; &lt;p&gt;Here's a screen shot of two portlets I'll be demontrating: ICEfaces Friends, and ICEfaces Chat:&lt;/p&gt; &lt;p&gt;&lt;a target="_blank" href="http://cdn.www.liferay.com/image/image_gallery?uuid=1fb2fc9f-4f1c-4492-b4cf-a9cfd9c47eb3&amp;amp;groupId=11150&amp;amp;t=1242777173315"&gt;&lt;img width="250" height="187" alt="" src="http://cdn.www.liferay.com/image/image_gallery?uuid=8f1bc474-051b-4f69-894b-6c07e5055772&amp;amp;groupId=11150&amp;amp;t=1242777411903" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The friends portlet is presence-aware, in that it has an application-scoped bean that listens to users logging-in/out of the portal. When it receives one of those events, ICEfaces Ajax Push will fire a visual effect, alerting the user of the friend's online status. If online, then the chat icon is activated. If the user clicks on the chat icon, then ICEfaces Ajax Push is used to achieve inter-portlet communication with the Chat portlet on the right. A new chat session is created, and users can chat with one another in near-real-time, again thanks to ICEfaces Ajax Push.&lt;/p&gt; &lt;p&gt;One of the things that I&amp;nbsp;love about JSF, is the elegant, clean separation of the Model, View, and Controller concerns of the MVC design pattern. Case in point: Here's the entire XHTML markup for the Chat portlet:.&lt;/p&gt; &lt;pre&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&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;f:view xmlns:c=&amp;quot;http://java.sun.com/jstl/core&amp;quot;
    xmlns:f=&amp;quot;http://java.sun.com/jsf/core&amp;quot;
    xmlns:ice=&amp;quot;http://www.icesoft.com/icefaces/component&amp;quot;
    xmlns:ui=&amp;quot;http://java.sun.com/jsf/facelets&amp;quot;
    xmlns:sn=&amp;quot;http://www.liferay.com/jsf/facelets/socialnetworking&amp;quot;&amp;gt;
    &amp;lt;ice:portlet styleClass=&amp;quot;portlet-content&amp;quot;&amp;gt;
        &amp;lt;sn:styling /&amp;gt;
        &amp;lt;ice:form&amp;gt;
            &amp;lt;ice:messages /&amp;gt;
            &amp;lt;c:set value=&amp;quot;#{chatRoomsModel.roomsWithUser}&amp;quot; var=&amp;quot;chatRoomsWithUser&amp;quot; /&amp;gt;
            &amp;lt;ice:panelTabSet rendered=&amp;quot;#{!empty chatRoomsWithUser}&amp;quot; value=&amp;quot;#{chatRoomsWithUser}&amp;quot; var=&amp;quot;chatRoom&amp;quot;&amp;gt;
                &amp;lt;ice:panelTab label=&amp;quot;#{chatRoom.name}&amp;quot;&amp;gt;
                    &amp;lt;ice:panelGroup id=&amp;quot;scroller&amp;quot; style=&amp;quot;overflow: auto; width: 100%; height: 250px;&amp;quot;&amp;gt;
                        &amp;lt;ice:dataTable rowClasses=&amp;quot;results-row,results-row alt&amp;quot;
                                width=&amp;quot;100%&amp;quot; value=&amp;quot;#{chatRoom.chatMessages}&amp;quot; var=&amp;quot;chatMessage&amp;quot;&amp;gt;
                            &amp;lt;ice:column style=&amp;quot;width: 50px;&amp;quot;&amp;gt;
                                &amp;lt;sn:friend
                                    portraitStyleClass=&amp;quot;avatar&amp;quot; portraitWidth=&amp;quot;30px&amp;quot; showJobTitle=&amp;quot;false&amp;quot;
                                    showOnlineStatus=&amp;quot;false&amp;quot; user=&amp;quot;#{chatMessage.user}&amp;quot; /&amp;gt;
                            &amp;lt;/ice:column&amp;gt;
                            &amp;lt;ice:column&amp;gt;
                                &amp;lt;ice:outputText value=&amp;quot;#{chatMessage.date}&amp;quot;&amp;gt;
                                    &amp;lt;f:convertDateTime pattern=&amp;quot;MM/dd/yyyy hh:mm:ss a&amp;quot; /&amp;gt;
                                &amp;lt;/ice:outputText&amp;gt;
                                &amp;lt;br /&amp;gt;
                                &amp;lt;ice:outputText value=&amp;quot;#{chatMessage.text}&amp;quot; /&amp;gt;
                            &amp;lt;/ice:column&amp;gt;
                        &amp;lt;/ice:dataTable&amp;gt;
                    &amp;lt;/ice:panelGroup&amp;gt;
                    &amp;lt;ice:inputText action=&amp;quot;#{chatRoomsBacking.addMessage(chatRoom)}&amp;quot; value=&amp;quot;#{chatRoomsBacking.messageText}&amp;quot; /&amp;gt;
                    &amp;lt;ice:commandButton action=&amp;quot;#{chatRoomsBacking.addMessage(chatRoom)}&amp;quot; value=&amp;quot;#{message['add-message']}&amp;quot; /&amp;gt;
                &amp;lt;/ice:panelTab&amp;gt;
            &amp;lt;/ice:panelTabSet&amp;gt;
        &amp;lt;/ice:form&amp;gt;
    &amp;lt;/ice:portlet&amp;gt;
&amp;lt;/f:view&amp;gt;
&lt;/pre&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Also, these portlets make heavy use of Facelets Composite Components, and demonstrate how you can create new JSF components entirely with XHTML markup.&lt;/p&gt; &lt;p&gt;Hope to see you at one of these conferences!&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2009-05-19T21:39:10Z</dc:date>
  </entry>
  <entry>
    <title>Podcast interview by Kito Mann of JSF Central regarding Liferay and ICEfaces</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/podcast-interview-by-kito-mann-of-jsf-central-regarding-liferay-and-icefaces" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/podcast-interview-by-kito-mann-of-jsf-central-regarding-liferay-and-icefaces</id>
    <updated>2009-05-06T12:16:09Z</updated>
    <published>2009-05-06T12:10:44Z</published>
    <summary type="html">&lt;p&gt;Back in October 2008 at the &lt;a href="http://www.jsfone.com/conference/washington_dc/2008/09/index.html"&gt;JSFOne conference&lt;/a&gt;, I&amp;nbsp;was interviewed by Kito Mann of JSF&amp;nbsp;Central regarding Liferay and ICEfaces. The podcast and transcript were recently published at the JSF&amp;nbsp;Central website:&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.jsfcentral.com/listings/R4013?link"&gt;http://www.jsfcentral.com/listings/R4013?link&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Among the topics discussed are:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Liferay and JSF&lt;/li&gt;&lt;li&gt;Liferay and ICEfaces&lt;/li&gt;&lt;li&gt;JSR-314 JSF&amp;nbsp;2.0&lt;/li&gt;&lt;li&gt;JSR-301 JSF&amp;nbsp;Portlet Bridge Standard&lt;/li&gt;&lt;li&gt;Liferay Roles and Security&lt;/li&gt;&lt;/ul&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2009-05-06T12:10:44Z</dc:date>
  </entry>
  <entry>
    <title>Making distinctions between different kinds of JSF managed-beans</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/making-distinctions-between-different-kinds-of-jsf-managed-beans" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/making-distinctions-between-different-kinds-of-jsf-managed-beans</id>
    <updated>2009-04-15T23:19:40Z</updated>
    <published>2009-04-13T15:37:01Z</published>
    <summary type="html">&lt;p&gt;JSF has a simple &lt;a href="http://en.wikipedia.org/wiki/Inversion_of_control"&gt;Inversion-of-Control (IoC) container&lt;/a&gt;&amp;nbsp;called the JSF&amp;nbsp;&lt;a href="http://www.oracle.com/technology/tech/java/newsletter/articles/jsf_pojo/index.html"&gt;Managed Bean Facility&lt;/a&gt; (MBF). Although it has a verbose XML&amp;nbsp;syntax, and is not as robust as the &lt;a href="http://en.wikipedia.org/wiki/Spring_Framework#Inversion_of_Control_container"&gt;Spring BeanFactory&lt;/a&gt;, &lt;a href="http://www.picocontainer.org/"&gt;PicoContainer&lt;/a&gt;, or the &lt;a href="http://www.jboss.org/jbossmc/"&gt;JBoss Microcontainer&lt;/a&gt;, the MBF does have the basics of an IoC container, and offers features like &lt;a href="http://en.wikipedia.org/wiki/Dependency_injection"&gt;dependency injection&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;When a POJO is managed by the JSF&amp;nbsp;MBF, it is typically referred to as a managed-bean. But if you're going to create a maintainable JSF webapp/portlet, it is necessary to distinguish between different kinds of managed-beans. This practice will also preserve the clean &lt;a href="http://en.wikipedia.org/wiki/Separation_of_concerns"&gt;separation of concerns&lt;/a&gt; that JSF provides by implementing the &lt;a href="http://en.wikipedia.org/wiki/Model-view-controller"&gt;Model-View-Controller&lt;/a&gt; (MVC)&amp;nbsp;design pattern:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;table&gt;     &lt;tbody&gt;         &lt;tr class="ui-autocomplete-odd"&gt;             &lt;th&gt;Managed-Bean Type&lt;/th&gt;             &lt;th&gt;Nickname&lt;/th&gt;             &lt;th&gt;Typical Scope&lt;/th&gt;         &lt;/tr&gt;         &lt;tr class="ui-autocomplete-even"&gt;             &lt;td&gt;&lt;em&gt;Model Managed-Bean&lt;/em&gt;&lt;/td&gt;             &lt;td&gt;&lt;em&gt;model-bean&lt;/em&gt;&lt;/td&gt;             &lt;td&gt;&lt;em&gt;session&lt;/em&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr class="ui-autocomplete-even"&gt;             &lt;td colspan="3"&gt;&lt;p&gt;Description: This type of managed-bean participates in the &amp;quot;Model&amp;quot;&amp;nbsp;concern of the MVC design pattern. When you see the word &amp;quot;model&amp;quot; -- think DATA. A JSF model-bean should be a POJO that follows the JavaBean design pattern with getters/setters encapsulating properties. The most common use case for a model bean is to be a database entity, or to simply represent a set of rows from the result set of a database query.&lt;/p&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr class="ui-autocomplete-odd"&gt;             &lt;td&gt;&lt;em&gt;Backing Managed-Bean&lt;/em&gt;&lt;/td&gt;             &lt;td&gt;&lt;em&gt;backing-bean&lt;/em&gt;&lt;/td&gt;             &lt;td&gt;&lt;em&gt;request&lt;/em&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr class="ui-autocomplete-odd"&gt;             &lt;td colspan="3"&gt;&lt;p&gt;Description:&amp;nbsp;This type of managed-bean participates in the &amp;quot;View&amp;quot; concern of the MVC design pattern. The purpose of a backing-bean is to support UI logic, and has a 1::1 relationship with a JSF&amp;nbsp;view, or a JSF&amp;nbsp;form in a Facelet composition. Although it typically has JavaBean-style properties with associated getters/setters, these are properties of the View -- not of the underlying application data model. JSF backing-beans may also have JSF actionListener and valueChangeListener methods.&lt;/p&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr class="ui-autocomplete-even"&gt;             &lt;td&gt;&lt;em&gt;Controller Managed-Bean&lt;/em&gt;&lt;/td&gt;             &lt;td&gt;&lt;em&gt;controller-bean&lt;/em&gt;&lt;/td&gt;             &lt;td&gt;&lt;em&gt;request&lt;/em&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr class="ui-autocomplete-even"&gt;             &lt;td colspan="3"&gt;&lt;p&gt;Description:&amp;nbsp;This type of managed-bean participates in the &amp;quot;Controller&amp;quot;&amp;nbsp;concern of the MVC design pattern. The purpose of a controller bean is to execute some kind of business logic and return a navigation outcome to the JSF navigation-handler. JSF controller-beans typically have JSF action methods (and not actionListener methods).&lt;/p&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr class="ui-autocomplete-odd"&gt;             &lt;td&gt;&lt;em&gt;Support Managed-Bean&lt;/em&gt;&lt;/td&gt;             &lt;td&gt;&lt;em&gt;support-bean&lt;/em&gt;&lt;/td&gt;             &lt;td&gt;&lt;em&gt;session / application&lt;/em&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr class="ui-autocomplete-odd"&gt;             &lt;td colspan="3"&gt;&lt;p&gt;Description:&amp;nbsp;This type of bean &amp;quot;supports&amp;quot; one or more views in the &amp;quot;View&amp;quot; concern of the MVC design pattern. The typical use case is supplying an ArrayList&amp;lt;SelectItem&amp;gt; to JSF h:selectOneMenu drop-down lists that appear in more than one JSF&amp;nbsp;view. If the data in the dropdown lists is particular to the user, then the bean would be kept in session scope. However, if the data applies to all users (such as a dropdown lists of provinces), then the bean would be kept in application scope, so that it can be cached for all users.&lt;/p&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr class="ui-autocomplete-even"&gt;             &lt;td&gt;&lt;em&gt;Utility Managed-Bean&lt;/em&gt;&lt;/td&gt;             &lt;td&gt;&lt;em&gt;utility-bean&lt;/em&gt;&lt;/td&gt;             &lt;td&gt;&lt;em&gt;application&lt;/em&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr class="ui-autocomplete-even"&gt;             &lt;td colspan="3"&gt;&lt;p&gt;Description:&amp;nbsp;This type of bean provides some type of &amp;quot;utility&amp;quot;&amp;nbsp;function to one or more JSF views. A good example of this might be a FileUpload bean that can be reused in multiple web applications.&lt;/p&gt;&lt;/td&gt;         &lt;/tr&gt;     &lt;/tbody&gt; &lt;/table&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Now... One of the main benefits in making fine distinctions like this is &lt;a href="http://en.wikipedia.org/wiki/Loose_coupling"&gt;loose coupling&lt;/a&gt;. What's that you ask? Well let's first take a look at an example of tight coupling, where MVC concerns can be smashed/confused into a single managed-bean:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;pre&gt;
public class ModelAndBackingAndControllerBean {

	private String fullName; // model-bean property
	private boolean privacyRendered; // backing-bean property

	// model-bean getter
	public String getFullName() {
		return fullName;
	}
	
	// model-bean setter
	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	// backing-bean getter
	public boolean isPrivacyRendered() {
		return privacyRendered;
	}

	// backing-bean setter
	public void setPrivacyRendered(boolean privacyRendered) {
		this.privacyRendered = privacyRendered;
	}

	// backing-bean actionListener for UI support logic
	public void togglePrivacySection(ActionEvent actionEvent) {
		privacyRendered = !privacyRendered;
	}

	// controller-bean business logic
	public String submit() {
		System.out.println(&amp;quot;fullName=&amp;quot; + fullName);
		return &amp;quot;success&amp;quot;;
	}
}
&lt;/pre&gt; &lt;p&gt;The problem here is that the bean would have to be kept in session scope because of the model-bean property. Additionally, what if we wanted to do some unit testing with mock model data? Can't do it. So in order to fix these problems, and to promote loose coupling, we would have three separate Java classes:&lt;/p&gt; &lt;pre&gt;
public class ModelBean {

	private String fullName;

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public String getFullName() {
		return fullName;
	}
}

public class BackingBean {

	private boolean privacyRendered;

	public void setPrivacyRendered(boolean privacyRendered) {
		this.privacyRendered = privacyRendered;
	}

	public boolean isPrivacyRendered() {
		return privacyRendered;
	}

	public void togglePrivacySection(ActionEvent actionEvent) {
		privacyRendered = !privacyRendered;
	}

}

public class ControllerBean {

	private ModelBean modelBean;
	
	public ModelBean getModelBean() {
		return modelBean;
	}

	public void setModelBean(ModelBean modelBean) {
		// Dependency injected from the JSF managed-bean facility
		this.modelBean = modelBean;
	}

	public String submit() {
    	System.out.println(&amp;quot;fullName=&amp;quot; + getModelBean().getFullName());
        return &amp;quot;success&amp;quot;;
    }

}
&lt;/pre&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Now that the beans are found in different classes, they can all be kept in their appropriate scopes. The model-bean can be kept in session scope, and the backing-bean and controller-bean can be kept in request scope, thus saving memory resources on the server.&lt;/p&gt; &lt;p&gt;Finally, we can use the dependency injection features of the JSF MBF in order to inject the model-bean into the controller-bean. This can be seen in the following WEB-INF/faces-config.xml example, where the #{modelBean} Expression Language (EL) binding is used:&lt;/p&gt; &lt;pre&gt;
&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
&amp;lt;faces-config xmlns=&amp;quot;http://java.sun.com/xml/ns/javaee&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;
	xsi:schemaLocation=&amp;quot;http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd&amp;quot;
	version=&amp;quot;1.2&amp;quot;&amp;gt;
	&amp;lt;managed-bean&amp;gt;
		&amp;lt;managed-bean-name&amp;gt;modelBean&amp;lt;/managed-bean-name&amp;gt;
		&amp;lt;managed-bean-class&amp;gt;myproject.ModelBean&amp;lt;/managed-bean-class&amp;gt;
		&amp;lt;managed-bean-scope&amp;gt;session&amp;lt;/managed-bean-scope&amp;gt;
	&amp;lt;/managed-bean&amp;gt;
	&amp;lt;managed-bean&amp;gt;
		&amp;lt;managed-bean-name&amp;gt;backingBean&amp;lt;/managed-bean-name&amp;gt;
		&amp;lt;managed-bean-class&amp;gt;myproject.BackingBean&amp;lt;/managed-bean-class&amp;gt;
		&amp;lt;managed-bean-scope&amp;gt;request&amp;lt;/managed-bean-scope&amp;gt;
	&amp;lt;/managed-bean&amp;gt;
	&amp;lt;managed-bean&amp;gt;
		&amp;lt;managed-bean-name&amp;gt;controllerBean&amp;lt;/managed-bean-name&amp;gt;
		&amp;lt;managed-bean-class&amp;gt;myproject.ControllerBean&amp;lt;/managed-bean-class&amp;gt;
		&amp;lt;managed-bean-scope&amp;gt;request&amp;lt;/managed-bean-scope&amp;gt;
		&amp;lt;managed-property&amp;gt;
			&amp;lt;property-name&amp;gt;modelBean&amp;lt;/property-name&amp;gt;
			&amp;lt;value&amp;gt;#{modelBean}&amp;lt;/value&amp;gt;
		&amp;lt;/managed-property&amp;gt;
	&amp;lt;/managed-bean&amp;gt;
&amp;lt;/faces-config&amp;gt;
&lt;/pre&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2009-04-13T15:37:01Z</dc:date>
  </entry>
  <entry>
    <title>Lazy Loading a JSF DataModel for an ICEfaces ice:dataTable</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/lazy-loading-a-jsf-datamodel-for-an-icefaces-ice:datatable" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/lazy-loading-a-jsf-datamodel-for-an-icefaces-ice:datatable</id>
    <updated>2008-11-06T00:10:07Z</updated>
    <published>2008-11-05T20:33:26Z</published>
    <summary type="html">&lt;br /&gt;
&lt;p&gt;Iterator components like the &lt;a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/h/dataTable.html"&gt;JSF h:dataTable&lt;/a&gt; and &lt;a href="http://www.icesoft.com/developer_guides/icefaces/components/dataTableDoc.html"&gt;ICEfaces ice:dataTable&lt;/a&gt; have two special attributes: &lt;b&gt;value&lt;/b&gt; and &lt;b&gt;var&lt;/b&gt;. The &lt;b&gt;value&lt;/b&gt; attribute is typically bound to a JSF model-managed-bean, and the &lt;b&gt;var&lt;/b&gt; attribute introduces a new variable into the JSF Expression Language (EL) like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;ice:dataTable &lt;b&gt;value&lt;/b&gt;=&amp;quot;#{modelBean.rows}&amp;quot; &lt;b&gt;var&lt;/b&gt;=&amp;quot;row&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ice:column&amp;gt;&lt;br /&gt;
&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;&lt;br /&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;lt;ice:outputText value=&amp;quot;#{msgs.firstName}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/f:facet&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ice:outputText value=#{&lt;b&gt;row&lt;/b&gt;.firstName}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/ice:column&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;
&amp;lt;/ice:dataTable&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The ModelBean.getRows() method can return a variety of types, but in my experience the most typical one is a generic java.util.List like this:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;public List&amp;lt;Row&amp;gt; getRows() {...}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Under the hood, JSF is expecting the value attribute to contain an instance of a &lt;a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/model/DataModel.html"&gt;JSF DataModel&lt;/a&gt; object. In fact, if you don't return a DataModel, JSF will implicitly wrap your return value with a wrapper class, such as the &lt;a href="http://java.sun.com/javaee/javaserverfaces/1.2/docs/api/javax/faces/model/ListDataModel.html"&gt;ListDataModel&lt;/a&gt; for values of type java.util.List.&lt;/p&gt;
&lt;p&gt;Typically, the model bean that contains the data is kept in JSF session scope or ICEfaces extended-request scope. This is fine if you only have 10 or 20 rows in the result set, but what if you have 1,000,000 rows? Obviously there is a scalability concern in such a case, especially since the user is only going to be viewing 10 or 20 rows at a time in the browser.&lt;/p&gt;
&lt;p&gt;Unfortunately, the JSF spec does not provide a way of loading data on demand (popularly known as &amp;quot;lazy loading&amp;quot;). I've seen several posts on how to do this, but I thought it would be nice to develop a persistence-technology-independent solution.&lt;/p&gt;
&lt;p&gt;To this end, I wrote an abstract class named LazyDataModel.java that is meant to be subclassed into a concrete implementation. Feel free to download the &lt;a href="http://www.liferay.com/c/document_library/get_file?p_l_id=745520&amp;amp;folderId=1544410&amp;amp;name=DLFE-1016.zip"&gt;LazyDataModel.java&lt;/a&gt; (zipped) source code.&lt;/p&gt;
&lt;p&gt;Here are the three methods you will need to supply in your concrete implementation:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;public abstract int getRowsPerPage();&lt;br /&gt;
&lt;br /&gt;
public abstract int countRows();&lt;br /&gt;
&lt;br /&gt;
public abstract List&amp;lt;DTO&amp;gt; findRows(int startRow, int finishRow);&lt;br /&gt;
&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The DTO marker implies that this class is meant to be used at the JSF UI layer of a portlet/webapp, and that it is meant to be used in conjunction with the &lt;a href="http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html"&gt;Data Transfer Object&lt;/a&gt; design pattern (formerly known as the Value Object / VO design pattern).&lt;/p&gt;
&lt;p&gt;BTW, in order for this to be of benefit to the end user, you'll need to connect an &lt;a href="http://www.icesoft.com/developer_guides/icefaces/tld/ice/dataPaginator.html"&gt;ICEfaces ice:dataPaginator&lt;/a&gt; component to the ice:dataTable iterator. That will provide icons for navigation such as first-page, previous-page, next-page, and last-page.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2008-11-05T20:33:26Z</dc:date>
  </entry>
  <entry>
    <title>Webinar: Filthy Rich Portlets with ICEfaces and Liferay</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/webinar:-filthy-rich-portlets-with-icefaces-and-liferay" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/webinar:-filthy-rich-portlets-with-icefaces-and-liferay</id>
    <updated>2011-03-17T18:29:50Z</updated>
    <published>2008-09-30T14:18:29Z</published>
    <summary type="html">&lt;p&gt;&lt;b&gt;UPDATE: March 17, 2011&lt;/b&gt;&lt;/p&gt; &lt;p&gt;This blog post refers to an old version of ICEfaces (1.8). I would encourage you to try out the ICEfaces 2 versions of these portlets here: &lt;a href="http://www.portletfaces.org/portletfaces-bridge/examples"&gt;http://www.portletfaces.org/portletfaces-bridge/examples&lt;/a&gt;&lt;/p&gt; &lt;hr /&gt; &lt;p&gt;&lt;b&gt;ORIGINAL POST FOLLOWS&lt;/b&gt;: September 30, 2008&lt;/p&gt; &lt;p&gt;&lt;b&gt;Note&lt;/b&gt;: An &lt;b&gt;archive&lt;/b&gt; of the webinar is now available on ICEfaces .org in both .wmv and quicktime:&lt;br /&gt; &lt;a href="http://www.icefaces.org/main/resources/webinars.iface"&gt;http://www.icefaces.org/main/resources/webinars.iface&lt;/a&gt; (3rd item in the Archive Webinar list)&lt;br /&gt; &lt;br /&gt; Also, here is a video+transcript of a similar presentation given at the &lt;a href="http://www.jsfone.com"&gt;JSFOne&lt;/a&gt; conference:&lt;br /&gt; &lt;a href="http://java.dzone.com/videos/filthy-rich-portlets "&gt;http://java.dzone.com/videos/filthy-rich-portlets &lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;b&gt;Webinar Title:&lt;/b&gt; Filthy Rich Portlets with ICEfaces and Liferay&lt;/p&gt; &lt;p&gt;&lt;b&gt;Webinar Date/Time&lt;/b&gt;: Tuesday, October 14, 2008 1:00 PM - 2:00 PM EDT&lt;/p&gt; &lt;p&gt;&lt;b&gt;Webinar Link&lt;/b&gt;: &lt;a href="https://www1.gotomeeting.com/ojoin/451479046/1859554"&gt;https://www1.gotomeeting.com/ojoin/451479046/1859554&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;b&gt;Webinar Slides and Demo Downloads&lt;/b&gt;:&lt;/p&gt; &lt;ul&gt;     &lt;li&gt;&lt;a href="http://www.liferay.com/c/document_library/get_file?uuid=6784acb8-0828-4333-a178-f10980de8e2a&amp;amp;groupId=11150"&gt;Filthy Rich Portlet Slides&lt;/a&gt; (PDF, 5.8MB)&lt;/li&gt;     &lt;li&gt;&lt;a href="http://www.liferay.com/c/document_library/get_file?uuid=78ddea82-932a-40ca-8029-1511ea8a80be&amp;amp;groupId=11150"&gt;Source code for Demo #1: JSF Portlet&lt;/a&gt; (Liferay Plugins SDK ZIP, 1.4 MB)&lt;/li&gt;     &lt;li&gt;&lt;a href="http://www.liferay.com/c/document_library/get_file?uuid=0c22d8c1-5d42-4315-a974-4d17d38a3c6b&amp;amp;groupId=11150"&gt;Source code for Demo #2: ICEfaces Portlet&lt;/a&gt; (Liferay Plugins SDK ZIP, 4.7 MB)&lt;/li&gt;     &lt;li&gt;&lt;a href="http://www.liferay.com/c/document_library/get_file?uuid=af7443fc-c5ee-4351-a6b7-b3907c4e545d&amp;amp;groupId=11150"&gt;Source code for Demo #3: JSF IPC Portlet&lt;/a&gt; (Liferay Plugins SDK ZIP, 1.4 MB)&lt;/li&gt;     &lt;li&gt;&lt;a href="http://www.liferay.com/c/document_library/get_file?uuid=0970c358-cf04-46b5-81bf-856c817e5541&amp;amp;groupId=11150"&gt;Source code for Demo #4: ICEfaces IPC Ajax Push Portlet&lt;/a&gt; (Liferay Plugins SDK ZIP, 4.7 MB)&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;The sources are meant to be extracted into the &amp;quot;plugins&amp;quot; folder of the Liferay Plugins SDK. Fore more info, download the the &lt;a href="http://docs.liferay.com/4.3/official/liferay-43-plugins-guide.pdf"&gt;Liferay Plugins SDK documentation&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;b&gt;Webinar Overview:&lt;/b&gt;&lt;/p&gt; &lt;ul&gt;     &lt;li&gt;Portals and Portlets&lt;/li&gt;     &lt;li&gt;Liferay Portal&lt;/li&gt;     &lt;li&gt;JSF Portlets&lt;/li&gt;     &lt;li&gt;ICEfaces Portlets&lt;/li&gt;     &lt;li&gt;Standard Inter-Portlet Communication&lt;/li&gt;     &lt;li&gt;Ajax Push Inter-Portlet Communication&lt;/li&gt; &lt;/ul&gt; &lt;p&gt;&lt;a href="http://java.dzone.com/videos/filthy-rich-portlets "&gt;&lt;br /&gt; &lt;/a&gt;&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2008-09-30T14:18:29Z</dc:date>
  </entry>
  <entry>
    <title>Filthy Rich Portlets with ICEfaces at the JSFOne Conference!</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/filthy-rich-portlets-with-icefaces-at-the-jsfone-conference!" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/filthy-rich-portlets-with-icefaces-at-the-jsfone-conference!</id>
    <updated>2008-11-05T20:09:08Z</updated>
    <published>2008-08-21T00:37:25Z</published>
    <summary type="html">&lt;p&gt;&lt;b&gt;UPDATE!&lt;/b&gt;&lt;/p&gt; &lt;p&gt;Here is a &lt;b&gt;video+transcript&lt;/b&gt; of the presentation given at the &lt;a href="http://www.jsfone.com"&gt;JSFOne&lt;/a&gt; conference:&lt;br /&gt; &lt;a href="http://java.dzone.com/videos/filthy-rich-portlets "&gt;http://java.dzone.com/videos/filthy-rich-portlets &lt;/a&gt;&lt;/p&gt; &lt;p&gt;And here is a similar &lt;b&gt;webinar&lt;/b&gt; on ICEfaces .org in both .wmv and quicktime:&lt;br /&gt; &lt;a href="http://www.icefaces.org/main/resources/webinars.iface"&gt;http://www.icefaces.org/main/resources/webinars.iface&lt;/a&gt; (3rd item in the Archive Webinar list)&lt;br /&gt; &amp;nbsp;&lt;/p&gt; &lt;hr /&gt;&lt;p&gt;The &lt;a href="http://www.jsfone.com/conference/washington_dc/2008/09/index.html"&gt;JSFOne&lt;/a&gt; conference is being held from Thu 9/4/2008 - Sat 9/6/2008 in the Washington, DC area. Specifically, the event is being held at the Sheraton Premier Hotel in Vienna, VA.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I have the great privilege of speaking at the conference, and will be doing a talk titled &amp;quot;&lt;a href="http://www.jsfone.com/speaker_topic_view.jsp?topicId=1461"&gt;Filthy Rich Portlets with ICEfaces and Liferay&lt;/a&gt;.&amp;quot; To that end, I recently committed a new portlet to the Liferay Plugins trunk: &lt;a href="http://lportal.svn.sourceforge.net/viewvc/lportal/plugins/trunk/portlets/sample-icefaces-ipc-ajax-push-portlet/"&gt;sample-icefaces-ipc-ajax-push-portlet&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;It's actually one web archive (WAR) that contains two portlets. The &lt;b&gt;Customers&lt;/b&gt; &lt;b&gt;portlet&lt;/b&gt; simply shows a list of customers:&lt;/p&gt; &lt;p&gt;&lt;img width="358" height="147" src="http://www.liferay.com/image/image_gallery?img_id=1205814&amp;amp;t=1219279796647" alt="" /&gt;&lt;/p&gt; &lt;p&gt;When the user clicks on a customer, ICEfaces initiates an Ajax-Push event which updates the &lt;b&gt;Bookings&lt;/b&gt; &lt;b&gt;portlet&lt;/b&gt; with travel plans of the selected customer:&lt;/p&gt; &lt;p&gt;&lt;img width="431" height="361" src="http://www.liferay.com/image/image_gallery?img_id=1205810&amp;amp;t=1219279789513" alt="" /&gt;&lt;/p&gt; &lt;p&gt;But wait! There's more -- the IPC is bi-directional in the sense that if I change the first name or last name in the Bookings portlet, then the name will be updated in the Customers portlet too, all thanks to ICEfaces Ajax Push.&lt;/p&gt; &lt;p&gt;See you at JSFOne!&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2008-08-21T00:37:25Z</dc:date>
  </entry>
  <entry>
    <title>Switched from Windows to Mac</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/switched-from-windows-to-mac" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/switched-from-windows-to-mac</id>
    <updated>2008-08-21T00:35:50Z</updated>
    <published>2008-08-21T00:25:37Z</published>
    <summary type="html">&lt;p&gt;Perhaps I'm dating myself, but when I entered college in 1988, the Computer Science department required me to buy a &lt;a href="http://en.wikipedia.org/wiki/Macintosh_II"&gt;Mac II&lt;/a&gt; because it was the only personal computer of the day that ran a type of Unix. No, not Mac OS X silly, but &lt;a href="http://en.wikipedia.org/wiki/A/UX"&gt;A/UX&lt;/a&gt;. I never really used the Mac OS back then -- always did my projects under A/UX. Recently my buddy &lt;a href="http://weblogs.java.net/blog/edburns/"&gt;Ed Burns&lt;/a&gt; invited me to a &amp;quot;classic arcade game&amp;quot; exhibit at the Orlando Science center, and there happened to be an exhibit of Apple computers that was the personal collection of someone on display. You guessed it, there was a Mac II on display! Yes, that's right -- the computer I used in college was in a museum. Hey, it had an 80MB hard drive, and all my engineering friends only had 20MB drives in their IBM PCs running MS-DOS.&lt;br /&gt;&lt;br /&gt;After I graduated, I sold my Mac II to another student. My first job had me using Windows 3.1, and I've been using Microsoft operating systems as a desktop OS ever since. I moved to Windows 95, NT4, Windows 2000, XP, and finally Vista.&lt;/p&gt;&lt;p&gt;I found that fresh installs of Windows XP were nice and fast. But after installing/uninstalling programs, Windows would catch a sickness that would make the OS slow down. I found that every 3-6 months I had to wipe my hard drive and reinstall XP in order to get it back to top speed. My experience with Vista was much the same. After it got slow a second time, I decided I needed a change.&lt;/p&gt;&lt;p&gt;I almost went with Ubuntu Linux, but I had a non-Liferay email account that required Microsoft Exchange connectivity. So I ended up going with the Mac.&lt;/p&gt;&lt;p&gt;Yes, after 20 years (almost to the very day), I'm driving a Mac again. How about that!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2008-08-21T00:25:37Z</dc:date>
  </entry>
  <entry>
    <title>Sharing Data Between Portlets</title>
    <link rel="alternate" href="http://www.liferay.com/web/neil.griffin/blog/-/blogs/sharing-data-between-portlets" />
    <author>
      <name>Neil Griffin</name>
    </author>
    <id>http://www.liferay.com/web/neil.griffin/blog/-/blogs/sharing-data-between-portlets</id>
    <updated>2008-09-02T23:34:24Z</updated>
    <published>2008-08-16T10:37:59Z</published>
    <summary type="html">&lt;p&gt;If you want to share data between portlets, a common way to do that is by storing data in the user's session. Liferay Portal has some nice features for sharing session data like &amp;lt;shared-session-attributes&gt; in the liferay-portlet.xml file, and shared.session.attributes in the portal-ext.properties file.&lt;/p&gt; &lt;p&gt;But what if you're trying to go &lt;b&gt;session-less&lt;/b&gt;? Or what if you want to share data &lt;b&gt;globally&lt;/b&gt; for all users across sessions?&lt;/p&gt; &lt;p&gt;One way to do share data like this is to store the data in the portal's ROOT context. The first step is to create a GlobalStartupAction in the Liferay EXT environment, like this:&lt;/p&gt; &lt;pre&gt;
package com.foo.liferay.startup;

public class GlobalStartupAction extends SimpleAction {

	private static List&amp;lt;String&gt;&lt;string&gt; fooList; &lt;br /&gt; 	public List&amp;lt;String&gt; getFooList() {&lt;br /&gt;		return fooList;&lt;br /&gt;	}&lt;br /&gt;&lt;br /&gt;&lt;string&gt;	public static void &lt;br /&gt;	@Override public void run(String[] ids) throws ActionException {&lt;br /&gt;		// Cache all the data&lt;br /&gt;		fooList = new ArrayList&amp;lt;String&gt;&lt;string&gt;();&lt;br /&gt;		fooList.add(new String(&amp;quot;red&amp;quot;));&lt;br /&gt;		fooList.add(new String(&amp;quot;green&amp;quot;));&lt;br /&gt;		fooList.add(new String(&amp;quot;blue&amp;quot;));&lt;br /&gt;	}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/string&gt;&lt;/string&gt;&lt;/string&gt;&lt;/pre&gt; &lt;p&gt;Then, the GlobalStartupAction needs to be registered in the portal-ext.properties file. There is already a global startup action specified there for Liferay's own startup purposes, but thankfully this value can be a comma-delimited list, so we can just add the GlobalStartupAction after the Liferay one:&lt;/p&gt; &lt;p&gt;global.startup.events=com.liferay.portal.events.GlobalStartupAction&lt;b&gt;,com.foo.liferay.startup.GlobalStartupAction&lt;/b&gt;&lt;/p&gt; &lt;p&gt;And then inside each portlet, use the magic Liferay PortalClassInvoker to call the static getFooList() method. The PortalClassInvoker utility figures out the classloader for the Liferay Portal context before calling the specified method:&lt;/p&gt; &lt;pre&gt;
import com.liferay.portal.kernel.util.PortalClassInvoker;

public class ApplicationScopeBean {

    private static final List&lt;string&gt; fooList;&lt;br /&gt;&lt;br /&gt;    public ApplicationScopeBean() {&lt;br /&gt;        List&amp;lt;String&gt; fooList = (List&amp;lt;String&gt;) PortalClassInvoker.invoke(&amp;quot;com.foo.liferay.startup.GlobalStartupAction&amp;quot;, &amp;quot;getFooList&amp;quot;));&lt;/string&gt;&lt;/pre&gt;&lt;pre&gt;&lt;string&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/string&gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Neil Griffin</dc:creator>
    <dc:date>2008-08-16T10:37:59Z</dc:date>
  </entry>
</feed>


