<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-35974800</id><updated>2011-07-06T10:21:23.514+02:00</updated><title type='text'>Java Architecture &amp; Design</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://java-devel.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35974800/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://java-devel.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>bluebird</name><uri>http://www.blogger.com/profile/16444967658735254887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-35974800.post-6131858614576683308</id><published>2011-07-06T10:17:00.002+02:00</published><updated>2011-07-06T10:21:23.642+02:00</updated><title type='text'>GWT 2.3 and IncompatibleRemoteServiceException: This application is out of date</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Helvetica, Arial, sans-serif; font-size: 13px; color: rgb(51, 51, 51); line-height: 17px; "&gt;&lt;div class="wiki-content" style="font-size: 10pt; line-height: 13pt; margin-right: 24em; "&gt;&lt;div class="wiki-content" style="font-size: 10pt; line-height: 13pt; margin-right: 0px; "&gt;&lt;p style="font-size: 10pt; line-height: 13pt; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;b&gt;Behavior:&lt;/b&gt;&lt;/p&gt;&lt;p style="font-size: 10pt; line-height: 13pt; color: rgb(51, 51, 51); font-weight: normal; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-position: initial initial; background-repeat: initial initial; "&gt;After the first GWT-RPC-Call, the Tomcat logs an IncompatibleRemoteServiceException.&lt;/p&gt;&lt;p style="font-size: 10pt; line-height: 13pt; color: rgb(51, 51, 51); font-weight: normal; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;b&gt;Cause&lt;/b&gt;: &lt;/p&gt;&lt;p style="font-size: 10pt; line-height: 13pt; color: rgb(51, 51, 51); font-weight: normal; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-position: initial initial; background-repeat: initial initial; "&gt;Tomcat starts with a wrong version of gwt-servlet.jar (other than the compiled JavaScript expects)&lt;/p&gt;&lt;p style="font-size: 10pt; line-height: 13pt; color: rgb(51, 51, 51); background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;b&gt;Solution: &lt;/b&gt;&lt;/p&gt;&lt;p style="font-size: 10pt; line-height: 13pt; color: rgb(51, 51, 51); font-weight: normal; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-position: initial initial; background-repeat: initial initial; "&gt;Delete all wrong versions of gwt-servlet.jar&lt;/p&gt;&lt;p style="font-size: 10pt; line-height: 13pt; color: rgb(51, 51, 51); font-weight: normal; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; background-position: initial initial; background-repeat: initial initial; "&gt;
&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="labels-section" class="pageSection" style="margin-top: 40px; clear: both; border-top-width: 1px; border-top-style: dashed; border-top-color: rgb(204, 204, 204); margin-right: -20px; margin-bottom: 10px; margin-left: -20px; padding-top: 20px; padding-right: 20px; padding-bottom: 20px; padding-left: 20px; "&gt;&lt;div class="labels-editor"&gt;&lt;div id="labelsList"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35974800-6131858614576683308?l=java-devel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-devel.blogspot.com/feeds/6131858614576683308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-devel.blogspot.com/2011/07/gwt-23-and-incompatibleremoteserviceexc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35974800/posts/default/6131858614576683308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35974800/posts/default/6131858614576683308'/><link rel='alternate' type='text/html' href='http://java-devel.blogspot.com/2011/07/gwt-23-and-incompatibleremoteserviceexc.html' title='GWT 2.3 and IncompatibleRemoteServiceException: This application is out of date'/><author><name>bluebird</name><uri>http://www.blogger.com/profile/16444967658735254887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35974800.post-117042886810660490</id><published>2007-02-02T16:07:00.000+01:00</published><updated>2007-02-02T16:10:10.703+01:00</updated><title type='text'>Eclipse Plugin to test Regular Expressions</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://aqua-intern.de/public-www-dir/QuickRex.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 400px;" src="http://aqua-intern.de/public-www-dir/QuickRex.png" alt="" border="0" /&gt;&lt;/a&gt;

QuickRex is a nice little plugin for eclipse to check if your fantastic little regexp works as you expect.
It even has a live evaluation and higlights the matching text elements in green. Wonderful!
&lt;p&gt;
Update Site:

&lt;a href="http://bastian-bergerhoff.com/eclipse/features/"&gt;http://bastian-bergerhoff.com/eclipse/features/&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;
Screenshot:


&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35974800-117042886810660490?l=java-devel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-devel.blogspot.com/feeds/117042886810660490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-devel.blogspot.com/2007/02/eclipse-plugin-to-test-regular.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35974800/posts/default/117042886810660490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35974800/posts/default/117042886810660490'/><link rel='alternate' type='text/html' href='http://java-devel.blogspot.com/2007/02/eclipse-plugin-to-test-regular.html' title='Eclipse Plugin to test Regular Expressions'/><author><name>bluebird</name><uri>http://www.blogger.com/profile/16444967658735254887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35974800.post-117026994673595081</id><published>2007-01-31T19:57:00.000+01:00</published><updated>2007-02-01T18:49:49.446+01:00</updated><title type='text'>Loop over a list of model elements with an iterator faclet tag in JSF</title><content type='html'>&lt;p&gt;What about &lt;c:foreach&gt; and &lt;ui:repeat&gt;? Why do one need another loop tag? &lt;/ui:repeat&gt;&lt;/c:foreach&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ol&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;li&gt;If your container component has specific requirements on the type of its child component you can't go with the known tags because they put there own components as child-components on the container.&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;Both of them cannot be used if you need a dynamic evaluation of model elements&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=""&gt;You can use the tag as follows to iterator over a list of employees to print out there names:&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;pre class="code"&gt;&lt;p style=""&gt;&amp;lt;my:iterator value="#{bean.employees}" var="employee" &amp;gt;
&lt;&amp;lt;tr:outputText value="#{employee.name}" /&amp;gt;
&amp;lt;/my:iterator&amp;gt;
&lt;tr:outputtext value="#{employee.name}"&gt;&lt;/tr:outputtext&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=""&gt;The Tag assumes a value of type List.&lt;/p&gt;&lt;p style=""&gt; &lt;/p&gt;&lt;p&gt;The Java Code of the Facelets Tag Handler:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre class="code"&gt;&lt;p&gt;&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;&lt;span style=""&gt;public&lt;/span&gt; &lt;span style=""&gt;class&lt;/span&gt; IteratorTag &lt;span style=""&gt;extends&lt;/span&gt; TagHandler&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;{&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;  &lt;span style=""&gt;private&lt;/span&gt; &lt;span style=""&gt;final&lt;/span&gt; TagAttribute &lt;span style=""&gt;_value&lt;/span&gt;;&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;  &lt;span style=""&gt;private&lt;/span&gt; &lt;span style=""&gt;final&lt;/span&gt; TagAttribute &lt;span style=""&gt;_var&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; min-height: 15px;"&gt;
&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;  &lt;span style=""&gt;public&lt;/span&gt; IteratorTag(TagConfig p_arg0)&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;  {&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;    &lt;span style=""&gt;super&lt;/span&gt;(p_arg0);&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;    &lt;span style=""&gt;_value&lt;/span&gt; = getRequiredAttribute(&lt;span style=""&gt;"value"&lt;/span&gt;);&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;    &lt;span style=""&gt;_var&lt;/span&gt; = getRequiredAttribute(&lt;span style=""&gt;"var"&lt;/span&gt;);&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;  }&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; min-height: 15px;"&gt;
&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;  &lt;span style=""&gt;public&lt;/span&gt; &lt;span style=""&gt;void&lt;/span&gt; apply(FaceletContext p_facelets,&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;                    UIComponent p_parentComponent) &lt;span style=""&gt;throws&lt;/span&gt; IOException, FacesException, FaceletException, ELException&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;  {&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;&lt;span style=""&gt;    // get the value binding behind attr "value"&lt;/span&gt;&lt;/p&gt;&lt;p   style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;font-family:Monaco;font-size:11px;"&gt;    List list = (List) &lt;span style=""&gt;_value&lt;/span&gt;.getObject(p_facelets, List.&lt;span style=""&gt;class&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none; font-family: Monaco; font-size: 11px;"&gt;    &lt;span style=""&gt;int&lt;/span&gt; idIndex = 0;&lt;/p&gt;&lt;p style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none; font-family: Monaco; font-size: 11px;"&gt;    &lt;span style=""&gt;for&lt;/span&gt; (Object object : list)&lt;/p&gt;&lt;p style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none; font-family: Monaco; font-size: 11px;"&gt;    {&lt;/p&gt;&lt;p style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none; font-family: Monaco; font-size: 11px;"&gt;&lt;span style=""&gt;      // get the name of the variable&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none; font-family: Monaco; font-size: 11px;"&gt;      String varName = &lt;span style=""&gt;_var&lt;/span&gt;.getValue(p_facelets);&lt;/p&gt;&lt;p face="Monaco" size="11px" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;"&gt;&lt;span style=""&gt;      // set new variable into faclets attribute map&lt;/span&gt;&lt;/p&gt;&lt;p face="Monaco" size="11px" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;"&gt;      p_facelets.setAttribute(varName, object);&lt;/p&gt;&lt;p face="Monaco" size="11px" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;"&gt;      &lt;span style=""&gt;nextHandler&lt;/span&gt;.apply(p_facelets, p_parentComponent);&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; min-height: 15px;"&gt;      &lt;/p&gt;&lt;p face="Monaco" size="11px" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;"&gt;&lt;span style=""&gt;      // update ID of last created component from nextHandler&lt;/span&gt;&lt;/p&gt;&lt;p face="Monaco" size="11px" style="margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-size-adjust: none;"&gt;      String clientId = p_parentComponent.getClientId(p_facelets.getFacesContext()) + &lt;span style=""&gt;"_dynamicChild"&lt;/span&gt;+idIndex;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none;"&gt;      List&lt;uicomponent&gt; children = p_parentComponent.getChildren();&lt;/uicomponent&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none;"&gt;      children.get(children.size()-1).setId(clientId);&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none;"&gt;      idIndex++;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none;"&gt;    }&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none;"&gt;  }&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none;"&gt;}&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none;"&gt;&lt;/p&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35974800-117026994673595081?l=java-devel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-devel.blogspot.com/feeds/117026994673595081/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-devel.blogspot.com/2007/01/loop-over-list-of-model-elements-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35974800/posts/default/117026994673595081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35974800/posts/default/117026994673595081'/><link rel='alternate' type='text/html' href='http://java-devel.blogspot.com/2007/01/loop-over-list-of-model-elements-with.html' title='Loop over a list of model elements with an iterator faclet tag in JSF'/><author><name>bluebird</name><uri>http://www.blogger.com/profile/16444967658735254887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35974800.post-116983105010027742</id><published>2007-01-26T18:02:00.000+01:00</published><updated>2007-01-26T18:04:10.103+01:00</updated><title type='text'>Good Agile Karma

</title><content type='html'>&lt;p&gt;Leif hat mir folgenden, Artikel über Aigle Software Entwicklung zukommen lassen:&lt;/p&gt;&lt;p&gt;Abstract:&lt;/p&gt;&lt;p&gt;This article will focus on behavior patterns that enable teams to realize the most benefits of Agile rollout and sustain the experience. This article assumes that you have already implemented Agile process in your organization.&lt;/p&gt;&lt;p&gt;URL:&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.infoq.com/articles/agile-karma"&gt;http://www.infoq.com/articles/agile-karma&lt;/a&gt;&lt;/p&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica"&gt;&lt;br class="khtml-block-placeholder"&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35974800-116983105010027742?l=java-devel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-devel.blogspot.com/feeds/116983105010027742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-devel.blogspot.com/2007/01/good-agile-karma.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35974800/posts/default/116983105010027742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35974800/posts/default/116983105010027742'/><link rel='alternate' type='text/html' href='http://java-devel.blogspot.com/2007/01/good-agile-karma.html' title='Good Agile Karma&#xA;&#xA;'/><author><name>bluebird</name><uri>http://www.blogger.com/profile/16444967658735254887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35974800.post-116111948487796184</id><published>2006-10-17T21:17:00.000+02:00</published><updated>2006-10-18T01:23:46.536+02:00</updated><title type='text'>HowTo work with ADF Faces TreeModel</title><content type='html'>&lt;p&gt;
The ADF tree component (af:tree) uses instances of class TreeModel as model to render its content.
&lt;/p&gt;
Unfortunately the TreeModel works quick different as common java tree models. Nodes of the tree and aspecialy their children cannot be accessed throw a getter like "getChildren()" which makes navigation and mangement of the tree  a bit tricky.

&lt;p&gt;&lt;/p&gt;&lt;span style="font-size:130%;font-weight: bold;"&gt;
HowTo create a Adf TreeModel
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
The simples way to create a adf TreeModel instance is to define you own tree node class first:

&lt;pre class="code"&gt;public class TreeNode
{
  String _text;
  List&lt;TreeNode&gt; _children;
 
  public TreeNode(){}
  public TreeNode(String p_text) {_text = p_text};
  public String getText() {return _text;}
  public List&lt;TreeNode&gt; getChildren() {return _children;}
}&lt;/pre&gt;
Afterward you can setup a tree with it and convert it to an adf TreeModel

&lt;pre class="code"&gt;TreeNode rootNode = new TreeNode();
TreeNode firstLevel = new TreeNode("FirstLevelNode");
rootNode.getChildren.add( firstLevel );
firstLevel.getChildren.add( new TreeNode("SecondLevelNode") );
...
TreeModel _treeModel = new ChildPropertyModel(rootNode.getChildren(), "children");&lt;/pre&gt;

Note, that the children of the rootNode itself is not displayed but their children.
In your Jsp or Xhtml page, this TreeModel instance can be bound to the af:tree component as follows:
&lt;pre class="code"&gt;
&amp;lt;af:tree value="#{myJsfBean.treeModel}" var="node"&amp;gt;...&amp;lt;/af:tree&amp;gt;
&lt;/pre&gt;
&lt;p&gt;&lt;/p&gt;

&lt;span style="font-size:130%;font-weight: bold;"&gt;
How the ADF TreeModel works
&lt;/span&gt;
&lt;p&gt;
An ADF TreeModel instance always has a "current row" with one can "work" with. The current row can be a any (sub-) node of the tree.
&lt;p&gt; The "current row" can be accessed throw treeModel.getRowKey() which returns 
  an Object (debugging uncovered it to be a list of Object). 
&lt;br&gt;The "current row data", which is your TreeNode behind the "currentRow" is accessable 
  as shown in the following line: 
&lt;pre&gt;&lt;span style="font-size:100%;font-family:courier new;"&gt;TreeNode treeNode = (TreeNode) treeModel.getRowData();&lt;/span&gt;&lt;/pre&gt;

If you want to traverse throw the tree, you have to set the "current row" to a new value and use "enterContainer" and "leaveContainer" to go down or up the tree hierarchy.
Let's look at an example on how to find the rowKey for on of you TreeNode's.

&lt;p&gt;
Your implementation consists of two methods.
&lt;br&gt; One get's called by the client an manages tree state saving/restoring and uses the second method to do the "real work":

&lt;pre class="code"&gt;public Object getRowKey(TreeNode p_treeNode)
{
    Object oldRowKey = _treeModel.getRowKey();      // remember old state
    _treeModel.setRowIndex(-1);                     // navigate to "root" node
    Object searchedRowKey = _getRowKey(p_treeNode); // do the job
    _treeModel.setRowKey(oldRowKey);                // restore old state
    return searchedRowKey;
}&lt;/pre&gt;

The second method iterates over the children of the "current row" by setting the rowIndex with treeModel.setRowIndex(i)in a loop. It compares each "rowData" with p_treeNode and return it on success.
If it gets to a row which is not an empty container, it "enters" the container and calls itself recursively.

&lt;pre class="code"&gt;private Object _getRowKey(ITreeNode p_treeNode)
{
    Object rowKey = null;
    for (int i = 0; i &lt; _treeModel.getRowCount(); i++)
    {
      _treeModel.setRowIndex(i);
      ITreeNode node = (ITreeNode) _treeModel.getRowData();
      if (node.equals(p_menuNode))
      {
        rowKey = _treeModel.getRowKey();
      }
      else
      {
        if (!_treeModel.isContainerEmpty())
        {
        _treeModel.enterContainer();
        rowKey = _getRowKey(p_treeNode);
        _treeModel.exitContainer();
        }
      }
      if (rowKey != null)
        return rowKey;
    }
    return null;
}&lt;/pre&gt;

The opposite direction, to get your TreeNode for a valid rowKey is simple:

&lt;pre class="code"&gt;public ITreeNode getTreeNode(Object p_rowKey)
{
  Object oldRowKey = _treeModel.getRowKey();
  _treeModel.setRowKey(p_rowKey);
  ITreeNode treeNode = (ITreeNode) _treeModel.getRowData();
  _treeModel.setRowKey(oldRowKey);
  return treeNode;
}&lt;/pre&gt;

&lt;p&gt;
&lt;span style="font-size:130%;font-weight: bold;"&gt;
HowTo set a node expanded
&lt;/span&gt;
&lt;p&gt;
The adf tree component has an attribute "treeState" (an instance of PathSet) which contains a set of "rowKeys".  All rowKeys in this pathSet are rendered "expanded".
&lt;p&gt;
The best way to set nodes expanded is first to manage the treeState on your own. The PathSet needs a reference to the treeModel so when even you set a new  treeModel make sure to update the pathSet of expanded nodes. Here, we do it in the setter:

&lt;pre class="code"&gt;private PathSet _expandedNodes = new PathSet();
prviate TreeModel _treeModel = null;

protected void setTreeModel(TreeModel model)
{
  _treeModel = model;
  _expandedNodes.clear();
  _expandedNodes.setTreeModel(_treeModel);
}
public PathSet getExpandedNodes() {return _expandedNodes;}&lt;/pre&gt;

Bind your "expanded" attribut to the tree component, the component will only read the attribut.

&lt;pre class="code"&gt;&amp;lt;af:tree
  value="#{myJsfBean.treeModel}"
  var="node"
  treeState="#{myJsfBean.expandedNodes}"&amp;gt;
  ...
&amp;lt;/af:tree&amp;gt;&lt;/pre&gt;

To set your node expanded, you have to put the rowKey of your node in the set of expanded nodes.

&lt;pre class="code"&gt;public void setExpanded(ITreeNode p_treeNode, boolean p_expanded)
{
    Object rowKey = getRowKey(p_treeNode);
    if (p_expanded)
    {
      _expandedNodes.getKeySet().add(rowKey);
      List anchestorsOfCurrentNode =
           _treeModel.getAllAncestorContainerRowKeys(rowKey);
      _expandedNodes.getKeySet().addAll(anchestorsOfCurrentNode);
    }
    else
    {
      _expandedNodes.getKeySet().remove(rowKey);
    }
}&lt;/pre&gt;

Watch out that if the implementation above does not close the complete hierarchy of nodes if one node is set not not expanded.

&lt;p&gt;
&lt;span style="font-size:130%;font-weight: bold;"&gt;
Put it all Together
&lt;/span&gt;
&lt;p&gt;
Write your self a "TreeModelFacade" which does the dirty jobs and bind your af:tree's only to this facade. Your managed bean can create the tree of TreeNode's and instantiate the TreeModelFacade.

&lt;p&gt;
Take this as food for your thoughts:

&lt;pre class="code"&gt;public class TreeModelFacade
{
  public void setRootTreeNode(TreeNode p_rootNode) {...}
  public TreeModel getTreeModel() {//create ChildPropertyTreeModel form rootNode..}
  public ITreeNode getTreeNode(Object p_rowKey) {...}
  public Object getRowKey(TreeNode p_treeNode) {...}
  public void setExpanded(ITreeNode p_treeNode, boolean p_expanded) {...}
  public void refreshTreeModel() {//after changes in TreeNode tree ...}
  protected void setTreeModel(TreeModel model) {...}
}&lt;/pre&gt;

&lt;span style="font-size:130%;font-weight: bold;"&gt;
References
&lt;/span&gt;
&lt;p&gt;
&lt;a href="http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/tree.html"&gt;af:tree (tag documentation)&lt;/a&gt; 
&lt;br&gt;&lt;a href="http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/apidocs/oracle/adf/view/faces/model/TreeModel.html"&gt;TreeModel (java doc)&lt;/a&gt; 
&lt;br&gt;&lt;a href="http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/apidocs/oracle/adf/view/faces/model/PathSet.html"&gt;PathSet (java doc)&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35974800-116111948487796184?l=java-devel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java-devel.blogspot.com/feeds/116111948487796184/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java-devel.blogspot.com/2006/10/howto-work-with-adf-faces-treemodel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35974800/posts/default/116111948487796184'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35974800/posts/default/116111948487796184'/><link rel='alternate' type='text/html' href='http://java-devel.blogspot.com/2006/10/howto-work-with-adf-faces-treemodel.html' title='HowTo work with ADF Faces TreeModel'/><author><name>bluebird</name><uri>http://www.blogger.com/profile/16444967658735254887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
