<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Edem Morny's Tech Blog &#187; JSF</title>
	<atom:link href="http://edemmorny.wordpress.com/tag/jsf/feed/" rel="self" type="application/rss+xml" />
	<link>http://edemmorny.wordpress.com</link>
	<description>There's a fine line between walking and flying. It's called imagination.</description>
	<lastBuildDate>Tue, 22 Dec 2009 18:05:25 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='edemmorny.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/4ea55a85c39179bf099e4e3b297b60f2?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Edem Morny's Tech Blog &#187; JSF</title>
		<link>http://edemmorny.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://edemmorny.wordpress.com/osd.xml" title="Edem Morny&#8217;s Tech Blog" />
		<item>
		<title>Book Review: Packt&#8217;s JBoss Richfaces 3.3</title>
		<link>http://edemmorny.wordpress.com/2009/12/22/book-review-packts-jboss-richfaces-3-3/</link>
		<comments>http://edemmorny.wordpress.com/2009/12/22/book-review-packts-jboss-richfaces-3-3/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 17:45:45 +0000</pubDate>
		<dc:creator>Edem Morny</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Seam]]></category>
		<category><![CDATA[Richfaces]]></category>

		<guid isPermaLink="false">http://edemmorny.wordpress.com/2009/12/22/book-review-packts-jboss-richfaces-3-3/</guid>
		<description><![CDATA[
Summary
Very good book on what is arguably the most popular JSF component library. Covers the less well used but very important ajax features of Richfaces, including the use of ajax regions, containers as well as the plug-n-skin features.
Details
To all intents and purposes, this book is not for a beginner JSF developer, because it assumes familiarity [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=117&subd=edemmorny&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } 		H3 { margin-bottom: 0.08in } 		H3.western { font-family: "Liberation Sans", sans-serif } 		H3.ctl { font-family: "Lohit Hindi" } --></p>
<h3>Summary</h3>
<p>Very good book on what is arguably the most popular JSF component library. Covers the less well used but very important ajax features of Richfaces, including the use of ajax regions, containers as well as the plug-n-skin features.</p>
<h3>Details</h3>
<p>To all intents and purposes, this book is not for a beginner JSF developer, because it assumes familiarity with JSF 1.2. It starts off by delving into the history of the Richfaces component framework, which in eons past was just Ajax4jsf. It gives a short introduction (which is expounded later) on the ajax capabilities, the component set and skinability features of Richfaces for Rich Internet Application development.</p>
<p>It then sets off showing you step by step, how to create a simple JSF application that takes advantage of Richfaces as it&#8217;s JSF components library. It presents the seam-gen tool, a nifty tool for creating skeletons jsf projects based on the JBoss Seam project. Following the instructions on seam-gen enables you to create a quick prototype to start playing around with. This is then followed by instructions on how to manually create a project which is not Seam based, for fans of other frameworks which also integrate JSF, or for the pure JSF purists. This also includes configuring facelets support, and finally a look at how the IDEs provide support for development using the Richfaces component set.</p>
<p>The rest of the book, chapter by chapter, then focuses on using Richfaces components in building an interactive, intuitive and rich UI for your JSF application.</p>
<p>The following chapter delves into creating a JSF application using seam-gen (which I felt was repetitive, given that they&#8217;d actually created one in the preceding chapter), with additional parameters for defining the persistence model (entities) that were to be used in the application. It is worth noting from here forward almost all the examples now make use of the Seam framework&#8217;s programming model, something which could be a problem for those who are not Seam adherents. Also, with the stated assumption that this book is targeted at people with a basic knowledge of JSF, there didn&#8217;t seem to be the need to go over the basics of templating with Facelets and defining managed beans in a faces-config.xml file.</p>
<p>The next two chapters then introduce us to the intricate details of what the application is actually supposed to look like in terms of UI and functionality. The reader is taken through creating a database and generating entities from these, as well as creating a login page. I felt that these two chapters were the weakest chapters of the book, seeing as they dwelt more on entities, JPA and entities generation and Seam&#8217;s identity and login management than it did on the particular component framework in question – Richfaces. This may be explained by the fact that Richfaces enables the user to hook into Hibernate Validator for DRY enforcement on the domain model, the user could have been spared the parts on how to create the database, etc as well as Seam&#8217;s login management features.</p>
<p>Subsequently, the next chapter gives some very good insight on skinning, and implementing a means for the user to dynamically change skins. It explains the Richfaces&#8217;s use of XCSS, a powerful xml based means of describing CSS properties, as well as how to use some of the default Plug-n-Skin examples.</p>
<p>Chapter 6 then takes us deep into a real ajax experience, showing us the lesser explored but very important features provided by the rich:dataTable and rich:column components, as well as the appropriate use of the datascroller component for displaying tabular data. It also talks extensively about other data iteration components like the DataGrid and the DataList. Additionally, it goes into detail on the appropriate use of ajax placeholders, especially on using Richfaces outputPanel in achieving really ajax based changes to UI after changes are made to content, instead of just using JSF&#8217;s rendered attribute only.</p>
<p>The next chapter then deals with using the RichEditor as well as how to implement Drag&#8217;n'Drop support in your application. Finally an in-depth score is done on using the Richfaces FileUpload component.</p>
<p>Chapter 8 and 9 deal into more detail with skinning support in Richfaces, including how to create your own Plug&#8217;n'Skin skins, which can be quite easy if you follow the author&#8217;s guidance.</p>
<p>Chapter 10 dwells on advanced ajax capabilities such as Poll, Push as well as the partial update of data iteration components in the UI.</p>
<p>Of course, this book would not have been complete without discussing the Richfaces Component Development Kit (CDK). From creating a maven project using Richfaces&#8217;s CDK archetypes, to creating your own user defined components and registering them with the application, this chapter covers it all.</p>
<p>It ends with an appendix giving a short description of all the components currently provided by the Richfaces team.</p>
<h3>What I like about this book.</h3>
<p>This book contains a lot of information about how to really take advantage of the ajax capabilities provided by the Richfaces framework, and makes important mention of very valuable points to look out for when ajaxifying your application. I highly commend the indepth knowledge of Richfaces placeholders and the use of attributes like <em>ajaxSingle</em> and <em>process</em>, which gives your JSF application a true ajax feel.</p>
<h3>What I don&#8217;t like about this book.</h3>
<p>I&#8217;m an avowed fan of JBoss Seam, but I&#8217;d have preferred the book didn&#8217;t delve so deeply into Seam to make it&#8217;s point. As i mentioned before, some chapters dealt more with Seam than with Richfaces, and those may actually be quite annoying to someone who is developing with say Spring Web Flow.</p>
<p>Packt Publishing has attempted to pull off a book that provides an indepth look at the 3.3 version of  the popular JSF component library, Richfaces. In a lot of ways, I believe they have managed to do just that, give or take a few points.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edemmorny.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edemmorny.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edemmorny.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edemmorny.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edemmorny.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edemmorny.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edemmorny.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edemmorny.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edemmorny.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edemmorny.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=117&subd=edemmorny&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://edemmorny.wordpress.com/2009/12/22/book-review-packts-jboss-richfaces-3-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a863ee057fa55a68fef8fbf1a4d0d53?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edem</media:title>
		</media:content>
	</item>
		<item>
		<title>JSF Applications – JBoss Seam or Spring Web Flow?</title>
		<link>http://edemmorny.wordpress.com/2009/04/29/jsf-applications-%e2%80%93-jboss-seam-or-spring-web-flow/</link>
		<comments>http://edemmorny.wordpress.com/2009/04/29/jsf-applications-%e2%80%93-jboss-seam-or-spring-web-flow/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 08:22:14 +0000</pubDate>
		<dc:creator>Edem Morny</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Seam]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[JBoss Tools]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[spring ide]]></category>
		<category><![CDATA[web flow]]></category>

		<guid isPermaLink="false">http://edemmorny.wordpress.com/2009/04/29/jsf-applications-%e2%80%93-jboss-seam-or-spring-web-flow/</guid>
		<description><![CDATA[I&#8217;ve had opportunity to use JBoss Seam from its 1.0 days, and also Spring Web Flow. I must admit that both frameworks really do hold their own in providing you with a full stack for rapid application development. This post does not attempt to look at these frameworks as a whole, but to focus on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=101&subd=edemmorny&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p align="justify">I&#8217;ve had opportunity to use JBoss Seam from its 1.0 days, and also Spring Web Flow. I must admit that both frameworks really do hold their own in providing you with a full stack for rapid application development. This post does not attempt to look at these frameworks as a whole, but to focus on how easy it is to develop JSF<br />
applications in them.</p>
<p align="justify">
<p align="justify">JSF is a Java standard for web application development. Therefore to judge any framework that depends on or claims to accelerate JSF, we will focus on how it scales over the gaping holes that are not handled by the standard, not just how they stick to it. <span style="font-weight:normal;">B</span>elow are my observations. Note that the following points are not given in<br />
any order of importance.</p>
<h3 class="western">JSF&#8217;s UISelectItems Support</h3>
<p align="justify">From somewhere in it&#8217;s 1.x version, Seam has provided the ability to use just a normal java.util.List of your own domain objects e.g. List&lt;Student&gt; directly to populate JSF&#8217;s UISelectItem controls like list boxes, drop down lists etc using their &lt;s:selectItems/&gt; component and it&#8217;s attached &lt;s:convertEntity/&gt; tag. Additionally, enums are easily handled in like manner using &lt;s:convertEnum/&gt; and &lt;s:enumItem/&gt;.  This gets rid of the need to wrap domain objects in JSF SelectItem instances.</p>
<p align="justify">This is sorely lacking in Spring Faces, Spring&#8217;s JSF support for Web Flow, something I have even voted for in their JIRA instance.</p>
<p align="justify">
<h3 class="western">Conversation Propagation in a Different Browser Tab</h3>
<p align="justify">Seam provides the ability to invoke actions that start a new conversation or to move within states in a conversation using their provided &lt;s:button/&gt; or &lt;s:link/&gt; button and link respectively. Though Spring Faces has a Dojo backed<br />
&lt;sf:commandButton/&gt; and &lt;sf:commandLink/&gt;, these are not yet capable of achieving this.</p>
<p align="justify">
<h3 class="western">Integration with Hibernate Validator</h3>
<p align="justify">Following the DRY principle, it can be very useful if JSF can also hook into the validation defined on your domain model using the defacto validation standard, Hibernate Validator. As you may already know, JSR-303 Bean Validation is targeted at standardizing the definition and enforcement of validation rules on your domain model,<br />
with Hibernate Validator as the reference implementation. Seam provides the ability to enforce these validations in your JSF UI using the &lt;s:validateAll/&gt; tag.</p>
<p align="justify">Although requests have been made for this support, I&#8217;m yet to see it in Spring Faces.</p>
<p align="justify">
<h3 class="western">Popup Screens</h3>
<p align="justify">Sometimes it is cool to show modal panels for quick response from the user when interacting with the UI instead of a full page refresh. Spring Faces natively provides a Dojo based modal panel accessed just<br />
by setting “popup” to true on any view state.</p>
<p align="justify">It is important to note however that though not natively supported in Seam, both it&#8217;s default JSF component library, RichFaces and the supported alternatives, ICEFaces and Trinidad, all provide this functionality<br />
easily.</p>
<p align="justify">
<h3 class="western">Display of byte[] images</h3>
<p align="justify">JSF doesn&#8217;t provide any native control for the display of images from a byte array (byte[]) most probably retrieved from a database. The standard &lt;h:graphicImage/&gt; only deals with files accessible through a url. Seam however, provides support for display of images in a byte arrays using it&#8217;s &lt;s:graphicImage/&gt;.</p>
<p align="justify">There is no such support in Spring Faces, though RichFaces&#8217;s &lt;a4j:mediaOutput/&gt; could be used in displaying such content, however I have had problems using it with Spring Faces. ICEFaces also could be used to achieve this.</p>
<h3 class="western">File Upload</h3>
<p align="justify">Another vital component missing from the standard JSF toolkit is a file upload component of which Seam natively provides an &lt;s:fileUpload/&gt; component for achieving just that.</p>
<p align="justify">Unless you us a third party library like RichFaces or ICEFaces, I haven&#8217;t yet seen clear support for such a functionality in SpringFaces.</p>
<h3 class="western">Rendering Components Based on Access Rights</h3>
<p align="justify">Sometimes you want to hide a certain area of your UI from the user based on their roles/rights within the application. This is normally achieved in JSF using the “rendered” attribute on any tag or component. Seam provides a native way to easily hide or show components or sections using the s:hasRole EL function. An example of<br />
this is below</p>
<p align="justify">&lt;h:outputText value=”Hello”<br />
rendered=”#{s:hasRole(&#8216;Admin&#8217;)}”/&gt;</p>
<p align="justify">This same support is extended to its “s:hasPermission” function, allowing you to render components on the UI based on not only roles, but fine grained permissions even backed by the Drools engine. And these functions are accessible whether on the UI, in your navigation rules (when you use pages.xml or pdl) and even in your code on annotations.</p>
<p align="justify">Spring Faces has no native support for this on facelets (I think it&#8217;s only available on jsps). However, an open-source project, Acegi-JSF, has a UI component tag &lt;acegijsf:authorize/&gt; and other additional ones which allow you to render based on access rights. This is limited, in that it cannot be applied to the rendered” attributes of JSF components since it is by itself a component/tag, not an EL function like Seam&#8217;s approach. You have to be quite inventive (and verbose) to come up with your own solutions to this problem.</p>
<p align="justify">
<h3 class="western">Extended EL Capabilities</h3>
<p align="justify">JSF 1.2 is limited in it&#8217;s EL support, and as a result you cannot invoke an action with parameters on a facelet. The following is not allowed, though I&#8217;ve seen proposals to fix it natively in</p>
<p align="justify">&lt;h:commandButton action=”#{shop.buyProduct(product)}”/&gt;</p>
<p align="justify">Seam uses it&#8217;s own implementation of the EL-API called the JBoss EL, and this allows the invocation of such actions in a facelet and in your navigation rules.</p>
<p align="justify">Though Spring Faces also uses JBoss EL, for some reason I haven&#8217;t been able to do anything like the above in my facelet, though it is possible in flow (it is a heavily used feature Spring Web Flow).</p>
<p align="justify">
<h3 class="western">Automatic Detection of Converters &amp; Validators Through Annotations</h3>
<p align="justify">One may be forced to write some converters or validators needed to meet specific business logic needs. JSF requires you to specify these classes in it&#8217;s faces-config.xml file before being used.</p>
<p align="justify">Seam provides annotations for auto-discovering JSF converters and validators, meaning there is no need for the “xml hell” when creating these components.</p>
<p align="justify">Spring Faces doesn&#8217;t yet have this support.</p>
<h3 class="western">TimeZones &amp; Themes</h3>
<p align="justify">The JSF specification assumes that all dates and times are UTC. To override this behaviour,  a timezone must specified using an &lt;f:convertDateTime/&gt; on each date being displayed. The inconvenience of this cannot be overstated as I&#8217;ve had to deal with this. Using a Seam component on which the Time Zone may be specified in your application, Seam overrides this behaviour in your JSF application, a feature I&#8217;m yet to see in SpringFaces.</p>
<p align="justify">Also, most of today&#8217;s webapps come with the ability to change themes on the fly, but JSF has no native support for  themes. This support however is provided by Seam in a very easy to configure way, and is yet to make it to Spring Faces.</p>
<h3 class="western">Tools</h3>
<p align="justify">JSF by nature is designed with tools in mind, as result, tool support is an important part of adoption of JSF and every JSF framework&#8217;s tool support must be brought under the scope.</p>
<p align="justify">JBoss provides JBoss Tools, a superb set of tools for rapid application design. It&#8217;s Richfaces VPE provides wysiwyg, drag n&#8217; drop design of facelets with a palette of HTML,JSF, Facelets and Richfaces components. It also supports resolution of your seam components inside facelet using Seam component names as well as wysiwyg declaration of<br />
nagivation rules in both the standard JSF faces-config.xml or and Seam&#8217;s pages.xml. Even resolution of component names in code is also available. See the <a href="http://www.packtpub.com/developers-guide-for-jboss-tools-3/book/jbtpsd?utm_source=jbtpsd&amp;utm_medium=website&amp;utm_term=middle&amp;utm_content=image&amp;utm_campaign=packtpub.com" target="_blank">JBoss Tools Developer Guide</a> for more on this toolset.</p>
<p align="justify">Spring provides it&#8217;s own Spring IDE set of tools which also allow the resolution of Spring beans within your flow definitions. Unfortunately, there isn&#8217;t any wysiwig support and Spring beans cannot be resolved by the Richfaces VPE.</p>
<h2 class="western">Other Non-JSF Stuff For UI Developers</h2>
<h3 class="western">Conversation Switcher</h3>
<p align="justify">With both frameworks promising the ability to have long running conversations, it then becomes useful to be able to start different conversations concerning different things, and have knowledge on the UI of which conversations have been started and the state in which the user is in each conversation.</p>
<p align="justify">This is natively supported in Seam but not in Web Flow.</p>
<h3 class="western">Debug page</h3>
<p align="justify">It helps to know the state and content of the beans in your scopes, especially when you want to know why certain things are not showing up on your facelet, without having to set break points in your IDE and start a whole debugging process.</p>
<p align="justify">Seam gives you the ability to at any time in any conversation, see the contents of your components in their appropriate scopes. This I sorely missed in Web Flow.</p>
<h3 class="western">Summary</h3>
<p align="justify">There are a host of other things that we could also compare, but from these ones it is not difficult to see why people who develop using the JSF framework see Seam as a saviour. We could choose<br />
to chastise JSF itself for its shortcomings and use other frameworks but when someone comes along and <strong><em>makes standards like JSF more attractive as their first priority</em></strong>, I think they deserve the support and commendation. And that is what I believe is the problem with Spring Web Flow and it&#8217;s<br />
Spring Faces project.</p>
<p align="justify">Spring has it&#8217;s own MVC framework, SpringMVC which predates Web Flow. Web Flow can be developed either using SpringMVC or JSF aka Spring Faces. A lot of the limitations of Spring Faces noted here are already handled natively by SpringMVC. Obviously, Spring Faces has not had the kind of attention that the first class citizen, SpringMVC<br />
has in the world of Spring. In fact, one wonders if the sudden entrance of Spring Faces is not just a knee jerk reaction to Seam winning the JSF folks over.</p>
<p align="justify">I believe that if you had to develop a JSF application and did not have any investments in Spring already, it will make more sense to go for Seam as your preferred framework. Coupled with it&#8217;s advanced tooling, there isn&#8217;t as yet a better choice. Trust me, you won&#8217;t regret it.</p>
<p align="justify">Seam also has support for other web frameworks like GWT and Wicket. Though Seam&#8217;s support of Wicket is very young, it will be interesting to see what<br />
the community&#8217;s acceptance of it is.</p>
<p>Technorati Tags: <a class="performancingtags" rel="tag" href="http://technorati.com/tag/seam">seam</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/web%20flow">web flow</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/jsf">jsf</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/jboss">jboss</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/spring">spring</a></p>
<div><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=e4f30ef3-8cd6-8117-9d39-a0c9d83ddf83" alt="" /></div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edemmorny.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edemmorny.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edemmorny.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edemmorny.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edemmorny.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edemmorny.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edemmorny.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edemmorny.wordpress.com/101/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edemmorny.wordpress.com/101/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edemmorny.wordpress.com/101/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=101&subd=edemmorny&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://edemmorny.wordpress.com/2009/04/29/jsf-applications-%e2%80%93-jboss-seam-or-spring-web-flow/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a863ee057fa55a68fef8fbf1a4d0d53?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edem</media:title>
		</media:content>

		<media:content url="http://img.zemanta.com/pixy.gif?x-id=e4f30ef3-8cd6-8117-9d39-a0c9d83ddf83" medium="image" />
	</item>
		<item>
		<title>DZone Releases Richfaces and Seam UI RefCardz</title>
		<link>http://edemmorny.wordpress.com/2009/03/10/dzone-releases-richfaces-and-seam-ui-refcardz/</link>
		<comments>http://edemmorny.wordpress.com/2009/03/10/dzone-releases-richfaces-and-seam-ui-refcardz/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 09:27:49 +0000</pubDate>
		<dc:creator>Edem Morny</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[Seam]]></category>
		<category><![CDATA[Richfaces]]></category>

		<guid isPermaLink="false">http://edemmorny.wordpress.com/2009/03/10/dzone-releases-richfaces-and-seam-ui-refcardz/</guid>
		<description><![CDATA[As part of DZone&#8217;s aim of informing the developer, especially Java developers of their choices in tools and technologies to be productive in their fields, it regularly publishes RefCardz. These are concise, straight to the point publications highlighting appropriate uses of different technologies. They have been very insightful to me.
In recent weeks, I&#8217;ve participated in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=80&subd=edemmorny&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As part of <a href="http://www.dzone.com/links/index.html" target="_blank">DZone&#8217;s</a> aim of informing the developer, especially Java developers of their choices in tools and technologies to be productive in their fields, it regularly publishes RefCardz. These are concise, straight to the point publications highlighting appropriate uses of different technologies. They have been very insightful to me.</p>
<p>In recent weeks, I&#8217;ve participated in reviewing the publication of <a href="http://refcardz.dzone.com/refcardz/seam-ui" target="_blank">Seam UI</a> RefCard from Jacob Orshalick, the author of the just released <a href="http://www.amazon.com/Seam-Framework-Experience-Evolution-JBoss/dp/0137129394/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1236677038&amp;sr=8-1" target="_blank">Seam Framework: Experience the Evolution of Java EE</a> and a committer on the Seam project. It contains some useful information on some of the best practices for managing and configuraing your Seam application&#8217;s UI. Just grap a copy here.</p>
<p>And just yesterday, a RefCard on <a href="http://refcardz.dzone.com/refcardz/richfaces" target="_blank">Richfaces</a> was published from the horse&#8217;s own mouth &#8211; Excadel. This publication features Nick Belaevski, Ilya Shaikovsky, Jay Balunas and <a href="http://mkblog.exadel.com/" target="_blank">Max Katz</a> &#8211; author of the well acclaimed <a href="http://www.amazon.com/Practical-RichFaces-Max-Katz/dp/1430210559/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1236677212&amp;sr=1-1" target="_blank">Practical Richfaces</a>.</p>
<p>These give fans of Seam and Richfaces enough food for thought for the next few months. Enjoy chewing on them as I have.</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=3faa6557-1418-4b77-9e5e-9aa81958b41e" alt="" /></div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edemmorny.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edemmorny.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edemmorny.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edemmorny.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edemmorny.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edemmorny.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edemmorny.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edemmorny.wordpress.com/80/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edemmorny.wordpress.com/80/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edemmorny.wordpress.com/80/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=80&subd=edemmorny&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://edemmorny.wordpress.com/2009/03/10/dzone-releases-richfaces-and-seam-ui-refcardz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a863ee057fa55a68fef8fbf1a4d0d53?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edem</media:title>
		</media:content>

		<media:content url="http://img.zemanta.com/pixy.gif?x-id=3faa6557-1418-4b77-9e5e-9aa81958b41e" medium="image" />
	</item>
		<item>
		<title>RichFaces plugin Released for NetBeans 6.1</title>
		<link>http://edemmorny.wordpress.com/2008/05/19/richfaces-plugin-released-for-netbeans-61/</link>
		<comments>http://edemmorny.wordpress.com/2008/05/19/richfaces-plugin-released-for-netbeans-61/#comments</comments>
		<pubDate>Mon, 19 May 2008 09:45:14 +0000</pubDate>
		<dc:creator>Edem Morny</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[Seam]]></category>
		<category><![CDATA[Richfaces]]></category>

		<guid isPermaLink="false">http://edemmorny.wordpress.com/?p=55</guid>
		<description><![CDATA[&#60; Seam PDF Rendering
Last week Geertjan Wielanga released a plugin he&#8217;d been working on for RichFaces tag support in NetBeans. I gave it a shot and its not bad.
Its meant to provide tag support as well as drag and drop of RichFaces controls on the palette. Interestingly this support is meant for both jsps and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=55&subd=edemmorny&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://edemmorny.wordpress.com/2008/03/31/seam-pdf-rendering-and-jpa-native-queries/">&lt; Seam PDF Rendering</a></p>
<p>Last week <a href="http://blogs.sun.com/geertjan/">Geertjan</a> Wielanga released a <a href="https://nbrichfacessupport.dev.java.net/index.html">plugin</a> he&#8217;d been working on for RichFaces tag support in NetBeans. I gave it a shot and its not bad.</p>
<p>Its meant to provide tag support as well as drag and drop of RichFaces controls on the palette. Interestingly this support is meant for both jsps and facelets. But seriously speaking, how many people are using RichFaces on jsps instead of on Facelets? Since this plugin only works with NetBeans 6.1 and the facelets support plugin does not work with 6.1, I really wonder what use it is to me and to a significant number of others.</p>
<p>This is really causing me to worry for Sun. Anyone doing anything new in JSF is not going with JSPs if they really know what is best for them, but rather with Facelets. If Sun really wants JSF to catch up (alongside using NetBeans as their preferred JSF development tool) then they should provide us developers with at least some of what JBoss Tools provides &#8211; visual editing. I&#8217;ve been waiting for Sun&#8217;s Visual JSF to now support Facelets, cos there&#8217;s no way I&#8217;m sticking with Rave. I think a lot of people share this sentiment and it is the reason why everyone is praising Seam for the good work its doing.</p>
<p>If Sun has seen it fit to bring Jacob Hookom onto the JSF 2 EG as a sign of respect for what Facelets stands for, then it should stop sitting on the sidewalk with Facelets support in NetBeans and get some decent support for it (and I mean not just tag support). Most of us NetBeans fans are in a love hate relationship with it because of such political (in)decisions. Sun should continue taking developers seriously and see how to improve on it&#8217;s technologies with already proven ones instead of trying to stuff things down our throats that we don&#8217;t want to swallow.</p>
<hr />
28th May 2008</p>
<p>Ah. I just came across a release of the Facelets support for NetBeans 6.0 rebuilt to work with NetBeans 6.1. Good job by <a href="http://ifnu.artivisi.com">http://ifnu.artivisi.com</a>. <a href="http://project-template.googlecode.com/files/nbfaceletssupport-6.1.zip">Here</a> is the download. And thanks to Po-Ting Wu for the <a href="http://blogs.sun.com/poting/entry/build_and_install_facelets_support">rebuild instructions</a>.</p>
<p>Thanks also to Geertjan for the work on Richfaces support. JSF development will get better and easier!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/edemmorny.wordpress.com/55/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/edemmorny.wordpress.com/55/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edemmorny.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edemmorny.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edemmorny.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edemmorny.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edemmorny.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edemmorny.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edemmorny.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edemmorny.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edemmorny.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edemmorny.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=55&subd=edemmorny&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://edemmorny.wordpress.com/2008/05/19/richfaces-plugin-released-for-netbeans-61/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a863ee057fa55a68fef8fbf1a4d0d53?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edem</media:title>
		</media:content>
	</item>
		<item>
		<title>AJAX Magic With JSF DataTables in Seam 2.0</title>
		<link>http://edemmorny.wordpress.com/2008/03/04/ajax-magic-with-datatables-in-seam-20/</link>
		<comments>http://edemmorny.wordpress.com/2008/03/04/ajax-magic-with-datatables-in-seam-20/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 09:03:21 +0000</pubDate>
		<dc:creator>Edem Morny</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Seam]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[DataModel]]></category>
		<category><![CDATA[DataModelSelection]]></category>
		<category><![CDATA[DataTable]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Richfaces]]></category>

		<guid isPermaLink="false">http://edemmorny.wordpress.com/?p=41</guid>
		<description><![CDATA[&#60;Seam 2.0 on Tomcat &#8230; &#124; Seam Portlet Bridge Released &#62;
RichFaces 3.1.3.GA came with a some new controls, and the &#60;rich:listShuttle/&#62; was of some interest to me. However, for a particular use case I found it not sufficient for my needs, and had to roll out my own version of it with a little bit [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=41&subd=edemmorny&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://edemmorny.wordpress.com/2008/02/02/setup-of-seam-20-applications-for-tomcat-60/">&lt;Seam 2.0 on Tomcat &#8230;</a> | <a href="http://edemmorny.wordpress.com/2008/03/04/seam-jboss-portlet-bridge-realeased/">Seam Portlet Bridge Released &gt;</a><br />
RichFaces 3.1.3.GA came with a some new controls, and the &lt;rich:listShuttle/&gt; was of some interest to me. However, for a particular use case I found it not sufficient for my needs, and had to roll out my own version of it with a little bit of Ajax to add.</p>
<p class="MsoNormal">Let me use this simple scenario to display what I needed to do. Assuming you were keeping a shopping cart. After users select an item they want to buy, you want them to specify the quantity of that item following which their total charge is calculated for them on the fly. This I thought of doing using two DataTables just like the &lt;rich:listShuttle/&gt; appears but on a sleeker (or is it cruder?) level.</p>
<p class="MsoNormal">I defined an interface with a simple set of methods which I felt would do the trick called InPlaceEditing.</p>
<p class="MsoNormal">public interface InPlaceEditing {</p>
<p class="MsoNormal"><span>    </span>void editSelection();</p>
<p class="MsoNormal"><span>    </span>void addSelection();</p>
<p class="MsoNormal"><span>    </span>void removeSelection();</p>
<p class="MsoNormal"><span>    </span>void cancelSelection();</p>
<p class="MsoNormal">}</p>
<p class="MsoNormal">Here is my”shopper” Seam component which implements the interface. Notice the use of 2 DataModels “products” and “selectedItems” and their corresponding DataModelSelections. This is to enable me select from one table to another.</p>
<p class="MsoNormal">@Name(&#8220;shopper&#8221;)</p>
<p class="MsoNormal">@Scope(ScopeType.CONVERSATION)</p>
<p class="MsoNormal">public class Shopper implements java.io.Serializable, InPlaceEditing {</p>
<p class="MsoNormal"><span>    </span>private boolean edit;</p>
<p class="MsoNormal"><span>    </span>@In</p>
<p class="MsoNormal"><span>    </span>EntityManager entityManager;</p>
<p class="MsoNormal"><span>    </span>@In</p>
<p class="MsoNormal"><span>    </span>FacesMessages facesMessages;</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span>    </span>@DataModel</p>
<p class="MsoNormal"><span>    </span>List&lt;Product&gt; products;</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span>    </span>@DataModelSelection(&#8220;products&#8221;)</p>
<p class="MsoNormal"><span>    </span>private Product product;</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span>    </span>@DataModel</p>
<p class="MsoNormal"><span>    </span>private List&lt;CartItem&gt; selectedItems;</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span>    </span>@DataModelSelection(&#8220;selectedItems&#8221;)</p>
<p class="MsoNormal"><span>    </span>private CartItem selectedItem;</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span>    </span>@Out(required = false)</p>
<p class="MsoNormal"><span>    </span>private CartItem cartItem;</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span>    </span>private BigDecimal total = new BigDecimal(0.0);</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span>    </span>private static int count = 0;</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span>    </span>@Begin(flushMode=FlushModeType.MANUAL)</p>
<p class="MsoNormal"><span>    </span>public void beginShopping() {</p>
<p class="MsoNormal"><span>        </span>products = entityManager.createQuery(&#8220;Select p from Product p&#8221;).getResultList();</p>
<p class="MsoNormal"><span>        </span>selectedItems = new ArrayList&lt;CartItem&gt;();</p>
<p class="MsoNormal"><span>    </span>}</p>
<p class="MsoNormal">The beginShopping() method starts a conversation and FlushMode is set to MANUAL. This means that all changes made to entities will be made persistent only if I call flush() on entityManager. Seam defaults to AUTO which means all changes to all managed entities are merged into the persistence context after every Seam action call. Trust me, for the purposes of this trick, you DON&#8217;T want automatic persistence context merging! Anyway this action populates the “products” DataModel with products already entered into the database. The result is the table below.</p>
<p class="MsoNormal">&lt;a:outputPanel id=&#8221;productPanel&#8221;&gt;</p>
<p class="MsoNormal"><span>                    </span>&lt;rich:dataTable value=&#8221;#{products}&#8221; var=&#8221;product&#8221;&gt;</p>
<p class="MsoNormal"><span>                        </span>&lt;h:column&gt;</p>
<p class="MsoNormal"><span>                            </span>&lt;f:facet name=&#8221;header&#8221;&gt;Product&lt;/f:facet&gt;</p>
<p class="MsoNormal"><span>                 </span><span>           </span>&lt;a:commandLink value=&#8221;#{product.name}&#8221; actionListener=&#8221;#{shopper.editSelection}&#8221; reRender=&#8221;editPanel&#8221;/&gt;</p>
<p class="MsoNormal"><span>                        </span>&lt;/h:column&gt;</p>
<p class="MsoNormal"><span>                        </span>&lt;h:column&gt;</p>
<p class="MsoNormal"><span>                            </span>&lt;f:facet name=&#8221;header&#8221;&gt;Price&lt;/f:facet&gt;</p>
<p class="MsoNormal"><span>  </span><span>                          </span>#{product.price}</p>
<p class="MsoNormal"><span>                        </span>&lt;/h:column&gt;<span>                    </span></p>
<p class="MsoNormal"><span>                        </span>&lt;h:column&gt;</p>
<p class="MsoNormal"><span>                            </span>&lt;f:facet name=&#8221;header&#8221;&gt;Stock&lt;/f:facet&gt;</p>
<p class="MsoNormal"><span>                            </span>#{product.stock}</p>
<p class="MsoNormal"><span>          </span><span>              </span>&lt;/h:column&gt;</p>
<p class="MsoNormal"><span>                    </span>&lt;/rich:dataTable&gt;</p>
<p class="MsoNormal"><span>                </span>&lt;/a:outputPanel&gt;</p>
<p class="MsoNormal"> <a href="http://edemmorny.files.wordpress.com/2008/03/shopping_product_edit.jpg" title="Displayed editing panel"><img src="http://edemmorny.files.wordpress.com/2008/03/shopping_product_edit.thumbnail.jpg" alt="Displayed editing panel" /></a></p>
<p class="MsoNormal">A look at the section of the shop.xhtml facelet shows an &lt;a:commandLink/&gt; &#8211; an Ajaxified version of the &lt;h:commandButon/&gt;. This supplies our “shopper” component with the selected product through the “product” data model selection through Ajax. Also take note of the “reRender” and &lt;a:outputPanel/&gt; tags, which specify which areas of our page should be Ajax refreshed after certain actions are called.<span>  </span>In the editSelection() action a new CartItem (a join entity between a product and a shopping cart) containing the selected product is created and outjected.</p>
<p class="MsoNormal"><span> </span>public void editSelection() {</p>
<p class="MsoNormal"><span>        </span>if (edit == false) {</p>
<p class="MsoNormal"><span>            </span>cartItem = new CartItem();</p>
<p class="MsoNormal"><span>          </span><span>  </span>cartItem.setId(count++);</p>
<p class="MsoNormal"><span>            </span>cartItem.setProduct(product);</p>
<p class="MsoNormal"><span>            </span>cartItem.setSelected(true);</p>
<p class="MsoNormal"><span>            </span>return;</p>
<p class="MsoNormal"><span>        </span>}</p>
<p class="MsoNormal"><span>        </span>cartItem = selectedItem;</p>
<p class="MsoNormal"><span>        </span>cartItem.setSelected(true);</p>
<p class="MsoNormal"><span>        </span>edit = true;</p>
<p class="MsoNormal"><span>    </span>}</p>
<p class="MsoNormal">I want to use the same action to represent selecting a new product (from “products”) and editing an already existing CartItem (from “selectedItems”). This is achieved with a private “edit” boolan field, which by default is false.<span>  </span>Also since proper behaviour of DataModel and DataModelSelections depends on a properly implemented equals() method (i.e. instance uniqueness) I assigned artificial ids with the static “count” to each CartItem. Note that without setting flushMode to MANUAL, doing this will cause exceptions to be thrown down the lane somewhere. Finally setting the CartItem&#8217;s “selected” field to true enables the rendering of the panel in which the quantity of that product will be entered.</p>
<p class="MsoNormal"> <a href="http://edemmorny.files.wordpress.com/2008/03/shopping_product_edit.jpg" title="Displayed editing panel"><img src="http://edemmorny.files.wordpress.com/2008/03/shopping_product_edit.thumbnail.jpg" alt="Displayed editing panel" /></a></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><a href="http://edemmorny.files.wordpress.com/2008/03/shopping_product1_edit.jpg" title="DataTable with configured product"><img src="http://edemmorny.files.wordpress.com/2008/03/shopping_product1_edit.thumbnail.jpg" alt="DataTable with configured product" /></a></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Once the quantity is specified, the addSelection() action is called. Because of the boolean “edit” we are able to determine if this is a new product selection or one from the existing list and respond appropriately, calculating the total cost of the users purchases so far and modifying the corresponding DataModels appropriately. In the case of an edit, the old computed cost of a product is deducted from the total, and re-computed and added to the total. To guarantee that the change in costs will reflect properly, the edited “cartItem” is removed and re-inserted in to the “selectedItems” DataModel.</p>
<p class="MsoNormal">It is also very easy to remove an already configured CartItem, again with the combination of &lt;a:commandLink/&gt; and the “selectedItem” DataModelSelection.</p>
<p class="MsoNormal">public void removeSelection() {<span>    </span></p>
<p class="MsoNormal"><span>        </span>total.subtract(selectedItem.getCost());</p>
<p class="MsoNormal"><span>      </span><span>  </span>selectedItems.remove(selectedItem);</p>
<p class="MsoNormal"><span>    </span>}</p>
<p class="MsoNormal">Finally, the user may save their selection. This involves the creation of a new Cart object, which is persisted to get an ID and associated with the CartItems in the “selectedItems” DataModel. Note here that the fake Ids I generated for the CartItems will cause maximum trouble in the database, and so I set them to null to force the persistence context to generate proper Ids for them. Don&#8217;t forget the all important “entityManager.flush()” to make all changes permanent.</p>
<p class="MsoNormal"> <a href="http://edemmorny.files.wordpress.com/2008/03/shopping_product3_edit.jpg" title="Completed Shopping"><img src="http://edemmorny.files.wordpress.com/2008/03/shopping_product3_edit.thumbnail.jpg" alt="Completed Shopping" /></a></p>
<p class="MsoNormal">Finally I raise an<span>  </span>event (“shopper.events.CartEdit”) which is being observed by the “shopList” Seam<span>  </span>component&#8217;s list() action causing the “carts” DataModel to be refreshed with fresh data.</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span>    </span>@Factory(&#8220;carts&#8221;)</p>
<p class="MsoNormal"><span>    </span>@Observer(&#8220;shopper.events.CartEdited&#8221;)</p>
<p class="MsoNormal"><span>    </span>public void list(){</p>
<p class="MsoNormal"><span>        </span>Contexts.getSessionContext().set(&#8220;carts&#8221;, null);</p>
<p class="MsoNormal"><span>        </span>carts = entityManager.createQuery(&#8220;Select c from Cart c&#8221;).getResultList();<span>        </span></p>
<p class="MsoNormal"><span>    </span>}</p>
<p class="MsoNormal"> <a href="http://edemmorny.files.wordpress.com/2008/03/home2_edit.jpg" title="Carts DataTable displaying products selected"><img src="http://edemmorny.files.wordpress.com/2008/03/home2_edit.thumbnail.jpg" alt="Carts DataTable displaying products selected" /></a></p>
<p class="MsoNormal">The Job Is Done. This is use of Ajax and DataTables is quite simplistic, but I&#8217;ve used it in some really tight corners for some advance stuff. One scenario that I can see with this example is the requirement to remove a product from the list of products once selected and configured, or to put it back once it has been removed from the configured ones. Another will be how to edit an already persisted cart to remove or add products to that cart. I&#8217;ve just laid the foundation. With some tricks of your own, you should be able to achieve some serious magic.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/edemmorny.wordpress.com/41/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/edemmorny.wordpress.com/41/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edemmorny.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edemmorny.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edemmorny.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edemmorny.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edemmorny.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edemmorny.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edemmorny.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edemmorny.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edemmorny.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edemmorny.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=41&subd=edemmorny&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://edemmorny.wordpress.com/2008/03/04/ajax-magic-with-datatables-in-seam-20/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a863ee057fa55a68fef8fbf1a4d0d53?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edem</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/03/shopping_product_edit.thumbnail.jpg" medium="image">
			<media:title type="html">Displayed editing panel</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/03/shopping_product_edit.thumbnail.jpg" medium="image">
			<media:title type="html">Displayed editing panel</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/03/shopping_product1_edit.thumbnail.jpg" medium="image">
			<media:title type="html">DataTable with configured product</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/03/shopping_product3_edit.thumbnail.jpg" medium="image">
			<media:title type="html">Completed Shopping</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/03/home2_edit.thumbnail.jpg" medium="image">
			<media:title type="html">Carts DataTable displaying products selected</media:title>
		</media:content>
	</item>
		<item>
		<title>NetBeans Setup of Seam 2.0 Applications for Tomcat 6.0&#8243;</title>
		<link>http://edemmorny.wordpress.com/2008/02/02/setup-of-seam-20-applications-for-tomcat-60/</link>
		<comments>http://edemmorny.wordpress.com/2008/02/02/setup-of-seam-20-applications-for-tomcat-60/#comments</comments>
		<pubDate>Sat, 02 Feb 2008 14:01:11 +0000</pubDate>
		<dc:creator>Edem Morny</dc:creator>
				<category><![CDATA[Seam]]></category>
		<category><![CDATA[Facelets]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Tomcat]]></category>

		<guid isPermaLink="false">http://edemmorny.wordpress.com/?p=34</guid>
		<description><![CDATA[&#60; @RequestParameter and @Observer usage &#124; Ajax Magic with DataTables &#62;
Recently I&#8217;ve had need to begin developing a new application using Seam. However this time I&#8217;ve decided to go lightweight, so the obvious choice was Tomcat 6. I realized that the Seam plugin for NetBeans was limited to project generation for JBoss and so wasn&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=34&subd=edemmorny&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://edemmorny.wordpress.com/2008/01/24/bookmarkable-parameters-and-the-events-model-in-seam/">&lt; @RequestParameter and @Observer usage</a> | <a href="http://edemmorny.wordpress.com/2008/03/04/ajax-magic-with-datatables-in-seam-20/">Ajax Magic with DataTables &gt;</a></p>
<p>Recently I&#8217;ve had need to begin developing a new application using Seam. However this time I&#8217;ve decided to go lightweight, so the obvious choice was Tomcat 6. I realized that the Seam plugin for NetBeans was limited to project generation for JBoss and so wasn&#8217;t an option. I decided to create everything on my own. Thankfully there is an example of the booking application with build scripts for Tomcat 6, Glassfish, WebLogic and WebSphere <span style="font-style:normal;">under</span><i> jboss-seam-2.0.GA/examples/jpa. </i>So here&#8217;s how you can set up yours work on Tomcat 6.</p>
<p style="margin-bottom:0;">&nbsp;</p>
<p style="margin-bottom:0;"><a name="DDE_LINK" title="DDE_LINK"></a>First, build the tomcat example by running <i>ant tomcat6</i><span style="font-style:normal;">, which generates 2 folders – </span><i>dist-tomcat6 </i><span style="font-style:normal;">and </span><i>exploded-archives-tomcat6</i><span style="font-style:normal;">. With that done, create a library in NetBeans which you&#8217;ll add it to your project. I called mine “Seam4Tomcat” and added all the jar files in </span><i>jpa/exploded-archives-tomcat6/jboss-seam-jpa.war/WEB-INF/lib.</i></p>
<p style="margin-bottom:0;font-style:normal;"><a href="http://edemmorny.files.wordpress.com/2008/02/library_jar_edit.jpg" title="Adding a library"><img src="http://edemmorny.files.wordpress.com/2008/02/library_jar_edit.jpg" alt="Adding a library" /></a></p>
<p style="margin-bottom:0;font-style:normal;">Then create the project itself. Select the “Web Application” project type, specify Tomcat 6 as the target server and JavaEE 5 as the version of JavaEE. Next check Facelets as the framework to be used and create the project. Right click on the project and select “Properties”. Select “Libraries” on the left panel and “Add Library” to add your Seam4Tomcat (or whatever name you gave it) jars to your project. Remember to uncheck the Facelets related libraries provided by the NetBeans facelets support, since they are already in you newly added library.</p>
<p style="margin-bottom:0;font-style:normal;"><a href="http://edemmorny.files.wordpress.com/2008/02/add_library_edit.jpg" title="Add library to project"><img src="http://edemmorny.files.wordpress.com/2008/02/add_library_edit.jpg" alt="Add library to project" /></a></p>
<p style="margin-bottom:0;"><a name="DDE_LINK1" title="DDE_LINK1"></a><span style="font-style:normal;">Since the Seam filter needs to be installed to allow seam integration (as well as other configurations), just copy the contents of </span><i>jpa/exploded-archives-tomcat6/jboss-seam-jpa.war/WEB-INF/web.xml </i><span style="font-style:normal;">and paste them in your web.xml file. You may change the &lt;url-pattern&gt; under the “Faces Servlet” servlet mapping to the url you want from the default “*.seam”.</span></p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">Append this to the top of the web.xml file to add the blueSky RichFaces skin to RichFaces components you might use in the application.</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;context-param&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;param-name&gt;org.ajax4jsf.SKIN&lt;/param-name&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;param-value&gt;blueSky&lt;/param-value&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;/context-param&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">Note that your faces-config.xml will already contain the reference to the Facelet view handler as well after creating the project.</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;"><span style="font-style:normal;">Next, Seam gives you advanced navigation in its pages.xml file compared to JSF&#8217;s faces-config.xml file. To use it, just copy the </span><i>jpa/exploded-archives-tomcat6/jboss-seam-jpa.war/WEB-INF/pages.xml</i><span style="font-style:normal;"> into your WEB-INF folder. Also add the components.xml from the same directory to your WEB-INF folder. This is the most central file to any seam application and must always be there. </span></p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">We&#8217;ll need to connect to some database to begin work with. So right-click your project, go to “New” and select “Entity Classes from Database”. We&#8217;ll assume no existing datasource and create one from an existing database connection. Drop down the “Data Source” combo box and select “New Data Source”. Enter a jndi name (mine is “jdbc/example”) and select the database connection. Enter the username and password for connecting to that database and your tables will be displayed.</p>
<p style="margin-bottom:0;font-style:normal;"><a href="http://edemmorny.files.wordpress.com/2008/02/datasource_creation_edit.jpg" title="Data source creation"><img src="http://edemmorny.files.wordpress.com/2008/02/datasource_creation_edit.jpg" alt="Data source creation" /></a></p>
<p style="margin-bottom:0;font-style:normal;">Select the tables you want to generate entities for and click “Next”. You are then given the chance to edit the names of the Entities to be generated as well as specify the package within which they will be kept (mine is “example.entity”). NetBeans can generate named queries for you, but more importantly any JPA project needs a persistence unit. This consists of your entities and an ever so vital persistence.xml or orm.xml file.</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p><a href="http://edemmorny.files.wordpress.com/2008/02/generate_entities_edit.jpg" title="Generating entities"><img src="http://edemmorny.files.wordpress.com/2008/02/generate_entities_edit.jpg" alt="Generating entities" /></a></p>
<p style="margin-bottom:0;font-style:normal;">Click the “Create Persistence Unit” button to create a persistence.xml file. Enter a persistence unit name (note the name you give. It will be used later). Specify your persistence provider – NetBeans comes with TopLink, but for Seam Hibernate is the better persistence provider. Note that I&#8217;ve changed the “Data Source” from “jdbc/example” to “java:comp/env/jdbc/example”. This is the fully qualified JNDI name that will be used by the container to resolve the EntityManager resource we&#8217;ll be injecting into our code. Since our database tables already exist, we&#8217;ll select “None” for “Table Generation Strategy” and click “OK”. We are finished with everything now and will click “Finish” to end the wizard.</p>
<p style="margin-bottom:0;font-style:normal;"><a href="http://edemmorny.files.wordpress.com/2008/02/persistence_unit_edit.jpg" title="View of persistence.xml"><img src="http://edemmorny.files.wordpress.com/2008/02/persistence_unit_edit.jpg" alt="View of persistence.xml" /></a></p>
<p style="margin-bottom:0;font-style:normal;">The preceding process creates two very important files: context.xml and persistence.xml files. Every resource that would be used in Tomcat should be declared in context.xml as a resource. Here is mine from the process above. You are free to tweak yours as the need may be.</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;Context path=&#8221;/example&#8221;&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;Resource auth=&#8221;Container&#8221; driverClassName=&#8221;com.mysql.jdbc.Driver&#8221;</p>
<p style="margin-bottom:0;font-style:normal;">maxActive=&#8221;20&#8243; maxIdle=&#8221;10&#8243; maxWait=&#8221;-1&#8243;</p>
<p style="margin-bottom:0;font-style:normal;">name=&#8221;jdbc/example&#8221; password=&#8221;" type=&#8221;javax.sql.DataSource&#8221;</p>
<p style="margin-bottom:0;font-style:normal;">url=&#8221;jdbc:mysql://localhost:3306/knust&#8221; username=&#8221;edem&#8221;/&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;/Context&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">Here is my persistence.xml file as well. Note that I have changed the transaction-type to “RESOURCE_LOCAL” from “JTA”. However Seam provides JTA support for our application and therefore the &lt;jta-data-source&gt; declaration instead of &lt;non-jta-data-source&gt;. These must be exactly as it is here or your application will DEFINITELY give you errors.</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;persistence-unit name=&#8221;exampleDatabase&#8221; transaction-type=&#8221;RESOURCE_LOCAL&#8221;&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;jta-data-source&gt;java:comp/env/jdbc/example&lt;/jta-data-source&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;properties/&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;/persistence-unit&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;/persistence&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">Now go back to your components.xml file. If you did copy the one from the exploded jpa example, you should have the following declaration in this file.</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;core:manager conversation-timeout=&#8221;120000&#8243;</p>
<p style="margin-bottom:0;font-style:normal;">concurrent-request-timeout=&#8221;500&#8243;</p>
<p style="margin-bottom:0;font-style:normal;">conversation-id-parameter=&#8221;cid&#8221;/&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;transaction:entity-transaction entity-manager=&#8221;#{em}&#8221;/&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;persistence:entity-manager-factory name=&#8221;bookingDatabase&#8221;/&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;persistence:managed-persistence-context name=&#8221;em&#8221;</p>
<p style="margin-bottom:0;font-style:normal;">auto-create=&#8221;true&#8221;</p>
<p style="margin-bottom:0;font-style:normal;">entity-manager-factory=&#8221;#{bookingDatabase}&#8221;/&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">&lt;security:identity authenticate-method=&#8221;#{authenticator.authenticate}&#8221;/&gt;</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">First things first. Replace all instances of “bookingDatabase” with the name of your persistence unit (I told you to take note of that – mine is “exampleDatabase”). Secondly, by giving the name “em” to all references to EntityManager and managed persistence contexts, it means that your code can only inject the EntityManager under the same name like so</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">@In EntityManager em</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">If you use a different name to inject it don&#8217;t say I didn&#8217;t tell you about the errors you&#8217;ll be getting. Alternatively you could change it to “entityManager” or whatever, just make sure that you use the same name as declared in components.xml throughout your code.</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">The last but often most forgotten thing that needs to be added is a seam.properties file. I can recount the number of times I&#8217;ve had nightmarish debugging sessions when a fresh application I&#8217;d just created to display Seam to someone didn&#8217;t work because of this file. In NetBeans, just right-click the project, select “New” and the “Properties file”. Call it “seam” and do not put it in any package (which puts it in default).</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;">With all this done, you are good to go developing for Tomcat 6 using Seam. NetBeans offers some level of incremental deployment to Tomcat, detecting if Java classes have changed and redeploying the application. However, since NetBeans remotely deploy web applications to Tomcat, Tomcat will be reading from your project folder directly to deploy the application. This means that some changes like changes made to your facelets page will immediately appear on your web-browser. Just save the changes you make to a facelet, refresh your web browser and boom! For me that is enough. Tomcat deploys quickly and so redeploying when a Java class changes is not that painful.</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<p style="margin-bottom:0;font-style:normal;"><a target="_blank" href="http://damatrixtraining.googlegroups.com/web/SeamSchool.zip?gda=kq5bHj8AAADZsIrzngx5kodK7dsaxLw7gAeOgkLr8onc_B7nG2gzy2G1qiJ7UbTIup-M2XPURDRZIKOMKwkF9jweIsFtPHoL">Here&#8217;s</a> an application I created to display this process to a mate. It&#8217;s got all the configurations files, some entities and Seam components to get you started.</p>
<p style="margin-bottom:0;font-style:normal;">&nbsp;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/edemmorny.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/edemmorny.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edemmorny.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edemmorny.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edemmorny.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edemmorny.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edemmorny.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edemmorny.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edemmorny.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edemmorny.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edemmorny.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edemmorny.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=34&subd=edemmorny&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://edemmorny.wordpress.com/2008/02/02/setup-of-seam-20-applications-for-tomcat-60/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a863ee057fa55a68fef8fbf1a4d0d53?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edem</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/02/library_jar_edit.jpg" medium="image">
			<media:title type="html">Adding a library</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/02/add_library_edit.jpg" medium="image">
			<media:title type="html">Add library to project</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/02/datasource_creation_edit.jpg" medium="image">
			<media:title type="html">Data source creation</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/02/generate_entities_edit.jpg" medium="image">
			<media:title type="html">Generating entities</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/02/persistence_unit_edit.jpg" medium="image">
			<media:title type="html">View of persistence.xml</media:title>
		</media:content>
	</item>
		<item>
		<title>Using @RequestParameter and @Observer events model in Seam</title>
		<link>http://edemmorny.wordpress.com/2008/01/24/bookmarkable-parameters-and-the-events-model-in-seam/</link>
		<comments>http://edemmorny.wordpress.com/2008/01/24/bookmarkable-parameters-and-the-events-model-in-seam/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 16:11:14 +0000</pubDate>
		<dc:creator>Edem Morny</dc:creator>
				<category><![CDATA[Seam]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[Facelets]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[observer]]></category>
		<category><![CDATA[request parameters]]></category>
		<category><![CDATA[restful]]></category>

		<guid isPermaLink="false">http://edemmorny.wordpress.com/2008/01/24/bookmarkable-parameters-and-the-events-model-in-seam/</guid>
		<description><![CDATA[&#60;Simple DataTable Example &#124; Seam on Tomcat &#62;
One good thing that Seam adds to JSF is the ability to use GET requests to retrieve data. The JSF spec decided to make every request a post, and this makes it difficult to bookmark pages or fetch pages directly from entering a url along with some parameters.

Well [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=29&subd=edemmorny&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://edemmorny.wordpress.com/2008/01/10/seam-simple-data-table-conversation-example/">&lt;Simple DataTable Example</a> | <a href="http://edemmorny.wordpress.com/2008/02/02/setup-of-seam-20-applications-for-tomcat-60/">Seam on Tomcat &gt;</a></p>
<p>One good thing that Seam adds to JSF is the ability to use GET requests to retrieve data. The JSF spec decided to make every request a post, and this makes it difficult to bookmark pages or fetch pages directly from entering a url along with some parameters.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Well see how this problem is solved in Seam using a simple annotation: @RequestParameter. This annotation allows us to pass a request parameter to our Seam component. Its value is injected before any method is called, guaranteeing us that the request paremeter will be available to us to make use of in our code. A look at our previous example shows us that departmens belong to specific faculties. This means we will need to pass the particular faculty whose departments we want to see on our departmentList.xhtml page displaying departments. Here&#8217;s the code that does it in our departmentListing Seam component:</p>
<p style="margin-bottom:0;"><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	--></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em>@Stateful</em></p>
<p style="margin-bottom:0;"><em>@Name(&#8220;departmentListing&#8221;)</em></p>
<p style="margin-bottom:0;"><em>@Scope(ScopeType.SESSION)</em></p>
<p style="margin-bottom:0;"><em>public class DepartmentListBean implements DepartmentList {</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> @PersistenceContext(type=PersistenceContextType.EXTENDED)</em></p>
<p style="margin-bottom:0;"><em> EntityManager em;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> @DataModel</em></p>
<p style="margin-bottom:0;"><em> List&lt;Department&gt; departments;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> @DataModelSelection</em></p>
<p style="margin-bottom:0;"><em> private Department department;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> @In FacesMessages facesMessages;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> @RequestParameter</em></p>
<p style="margin-bottom:0;"><em> Integer facId;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> @Out(required=false,scope=ScopeType.SESSION)</em></p>
<p style="margin-bottom:0;"><em> Faculty faculty;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> @Factory(&#8220;departments&#8221;)</em></p>
<p style="margin-bottom:0;"><em> @Observer(&#8220;univseam.event.DepartmentChanged&#8221;)</em></p>
<p style="margin-bottom:0;"><em> public void departmentList() {</em></p>
<p style="margin-bottom:0;"><em> //select if a faculty id has been passed to us</em></p>
<p style="margin-bottom:0;"><em> if(facId != null){</em></p>
<p style="margin-bottom:0;"><em> try {</em></p>
<p style="margin-bottom:0;"><em> faculty = (Faculty) em.createQuery(&#8220;Select f from Faculty f where f.id=:id&#8221;).</em></p>
<p style="margin-bottom:0;"><em> setParameter(&#8220;id&#8221;, facId).getSingleResult();</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> } catch (NoResultException exception) {</em></p>
<p style="margin-bottom:0;"><em> facesMessages.add(&#8220;Non-existent faculty passed!&#8221;);</em></p>
<p style="margin-bottom:0;"><em> return;</em></p>
<p style="margin-bottom:0;"><em> }</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> }</em></p>
<p style="margin-bottom:0;"><em> //if the faculty is not null then select its departments</em></p>
<p style="margin-bottom:0;"><em> if (faculty != null) {</em></p>
<p style="margin-bottom:0;"><em> departments = em.createQuery(&#8220;Select d from Department d where d.faculty=:faculty&#8221;).</em></p>
<p style="margin-bottom:0;"><em> setParameter(&#8220;faculty&#8221;, faculty).getResultList();</em></p>
<p style="margin-bottom:0;"><em> return;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> }</em></p>
<p style="margin-bottom:0;"><em> facesMessages.add(&#8220;No departments under this faculty yet&#8221;);</em></p>
<p style="margin-bottom:0;"><em> }</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Our list of departments is as shown below.</p>
<p style="margin-bottom:0;"><a title="old dept list" href="http://edemmorny.files.wordpress.com/2008/01/dep_list_old_edit.jpg"><img src="http://edemmorny.files.wordpress.com/2008/01/dep_list_old_edit.jpg" alt="old dept list" /></a></p>
<p style="margin-bottom:0;">
<p><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	--></p>
<p style="margin-bottom:0;">The “facId” is a request parameter passed from the page displaying the list of faculties. The method departmentList() is annotated with @Factory(“departments”), which forces Seam to load up the list of departments into the “departments” ArrayList. Seam guarantees that the faculty id will be properly converted to an Integer and placed in the facId variable before we initialize our list of departments, enabling us to first select the particular faculty and pass it to the query to load the departments. Outjecting the faculty object to the Session context is necessary to this discuss and we&#8217;ll see why soon.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">But how was the request parameter passed? Well, the simple &lt;f:param&gt; tag in JSF allows use to do that. Take a look at this portion of the facultyList.xhtml facelet.</p>
<p style="margin-bottom:0;"><em> &lt;h:column&gt;</em></p>
<p style="margin-bottom:0;"><em> &lt;f:facet name=&#8221;header&#8221;&gt;Action&lt;/f:facet&gt;</em></p>
<p style="margin-bottom:0;"><em> &lt;s:link value=&#8221;Departments&#8221; view=&#8221;/departmentList.xhtml&#8221;&gt;</em></p>
<p style="margin-bottom:0;"><em> &lt;f:param name=&#8221;facId&#8221; value=&#8221;#{faculty.id}&#8221;/&gt;</em></p>
<p style="margin-bottom:0;"><em> &lt;/s:link&gt;</em></p>
<p style="margin-bottom:0;"><em>&lt;/h:column&gt;</em></p>
<p style="margin-bottom:0;"><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	--></p>
<p style="margin-bottom:0;">With the use of an &lt;s:link&gt; we are able to append the faculty id to our URL under the name facId and seam binds to that name using the RequestParameter.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	--></p>
<p style="margin-bottom:0;">Not only is RequestParemeter useful in searching, but can also be very helpful in determining if an entity is being edited or a new one being created. Here we are with a list of departments. We want to use the same page to edit as we do for new department creation. RequestParameter to the rescue.</p>
<p style="margin-bottom:0;"><em>@Stateful</em></p>
<p style="margin-bottom:0;"><em>@Name(&#8220;departmentManager&#8221;)</em></p>
<p style="margin-bottom:0;"><em>public class DepartmentManagerBean implements DepartmentManager {</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> @In</em></p>
<p style="margin-bottom:0;"><em> EntityManager entityManager;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> @In</em></p>
<p><em> </em> <!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	--></p>
<p style="margin-bottom:0;"><em> FacesMessages facesMessages;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> @In</em></p>
<p style="margin-bottom:0;"><em> Faculty faculty;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> @Out(required=false)</em></p>
<p style="margin-bottom:0;"><em> private Department department;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> @RequestParameter(&#8220;depId&#8221;)</em></p>
<p style="margin-bottom:0;"><em> Integer depId;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em> public void createDepartment() {</em></p>
<p style="margin-bottom:0;"><em> //if the department already exists, then allow an edit</em></p>
<p style="margin-bottom:0;"><em> if(depId != null){</em></p>
<p style="margin-bottom:0;"><em> try {</em></p>
<p style="margin-bottom:0;"><em> this.department = (Department) entityManager.createQuery(&#8220;Select d from Department d where d.id=:id&#8221;).setParameter(&#8220;id&#8221;,                 depId).getSingleResult();</em></p>
<p style="margin-bottom:0;"><em> } catch (NoResultException noResultException) {</em></p>
<p style="margin-bottom:0;"><em> facesMessages.add(&#8220;Invalid department&#8221;); </em></p>
<p style="margin-bottom:0;"><em> }</em></p>
<p style="margin-bottom:0;"><em> facesMessages.add(&#8220;Editing a department&#8221;); </em></p>
<p style="margin-bottom:0;"><em> return ;</em></p>
<p style="margin-bottom:0;"><em> }</em></p>
<p style="margin-bottom:0;"><em> //else instantiate a new department entity</em></p>
<p style="margin-bottom:0;"><em> this.department = new Department();</em></p>
<p style="margin-bottom:0;"><em> this.department.setFaculty(faculty);</em></p>
<p style="margin-bottom:0;"><em> facesMessages.add(&#8220;Creating a new department&#8221;); </em></p>
<p style="margin-bottom:0;"><em> return;</em></p>
<p style="margin-bottom:0;"><em>}</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Passing the department id enables us to find out if a department like this exists already, in which case we load up that department for editing. If not we create a new department instance, passing it the faculty to which it belongs (which we injected from the previously outjected instance).</p>
<p style="margin-bottom:0;">Look at how this is done in the departmentList.xhtml facelet.</p>
<p style="margin-bottom:0;"><em><br />
</em></p>
<p style="margin-bottom:0;"><em> &lt;h:column&gt;</em></p>
<p style="margin-bottom:0;"><em> &lt;f:facet name=&#8221;header&#8221;&gt;Action&lt;/f:facet&gt;</em></p>
<p style="margin-bottom:0;"><em> &lt;s:link id=&#8221;edit&#8221; value=&#8221;Edit&#8221;</em></p>
<p style="margin-bottom:0;"><em> view=&#8221;/department.xhtml&#8221; action=&#8221;#{departmentManager.createDepartment}&#8221; 					propagation=&#8221;begin&#8221;&gt; </em></p>
<p style="margin-bottom:0;"><em> &lt;f:param name=&#8221;depId&#8221; value=&#8221;#{department.id}&#8221;/&gt;</em></p>
<p style="margin-bottom:0;"><em> &lt;/s:link&gt;</em></p>
<p style="margin-bottom:0;"><em> &lt;/h:column&gt;</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">The page for modifying/creating a new department is below</p>
<p style="margin-bottom:0;"><a title="new department creation" href="http://edemmorny.files.wordpress.com/2008/01/new_dep_edit.jpg"><img src="http://edemmorny.files.wordpress.com/2008/01/new_dep_edit.jpg" alt="new department creation" /></a></p>
<p style="margin-bottom:0;"><!-- 		@page { size: 8.5in 11in; margin: 0.79in } 		P { margin-bottom: 0.08in } 	--></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Again this appends the department id as depId to the URL, and Seam makes it available to our departmentManager to use before the createDepartment method is called. Through this the department.xhtml facelet can be used both for creation and editing of department entities.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">I&#8217;ve also been looking at alternative ways of automatically refreshing a list when a new element has been added to it in the database. Since @Factory is called only if the referred to object is null, we need another way to reload the list of departments and add the new department as well. Seam has an event mechanism based on the Observer pattern. This allows me to raise events, and all observers of that event immediately get notified of it. After populating the fields of a department I call saveDepartment, which saves my entity to the database. I then raise my own pretentious event: &#8220;univseam.event.DepartmentChanged&#8221;.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><em>@End</em></p>
<p style="margin-bottom:0;"><em> public String saveDepartment() {</em></p>
<p style="margin-bottom:0;"><em> if(department.getId()!= null){</em></p>
<p style="margin-bottom:0;"><em> entityManager.merge(department);</em></p>
<p style="margin-bottom:0;"><em> facesMessages.add(&#8220;Department updated!&#8221;); </em></p>
<p style="margin-bottom:0;"><em> }else{</em></p>
<p style="margin-bottom:0;"><em> entityManager.persist(department);</em></p>
<p style="margin-bottom:0;"><em> facesMessages.add(&#8220;New department added!&#8221;);</em></p>
<p style="margin-bottom:0;"><em> } </em></p>
<p style="margin-bottom:0;"><em> Events.instance().raiseEvent(&#8220;univseam.event.DepartmentChanged&#8221;);</em></p>
<p style="margin-bottom:0;"><em> return &#8220;success&#8221;;</em></p>
<p style="margin-bottom:0;"><em> }</em></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Notice that the factory method that initializes the list of departments (displayed previously) is also annotated with @Observer(&#8220;univseam.event.DepartmentChanged&#8221;). This time the facId will be null, but faculty is still in session scope, so we are able to reload the list of departments as if it&#8217;s nobody&#8217;s business.</p>
<p style="margin-bottom:0;"><a title="Updated list of depts" href="http://edemmorny.files.wordpress.com/2008/01/dep_list_edit.jpg"><img src="http://edemmorny.files.wordpress.com/2008/01/dep_list_edit.jpg" alt="Updated list of depts" /></a></p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;">Seam events enable applications to be very stateful, updating themselves when changes happen on the fly. Combining it with request parameters even makes it more fun to do.</p>
<p style="margin-bottom:0;">
<p style="margin-bottom:0;"><a></a></p>
<hr />
<em>Added on 8th April 2008:</em><br />
<a href="http://damatrixtraining.googlegroups.com/web/univseam3.zip?gda=E9bjxD4AAAAYuDw_8XR6ikJubhY6LPoqpJtXgXbLUurxa2PJ2QtkbGG1qiJ7UbTIup-M2XPURDRhsnqxC-MpjdHln2JCWLgH&amp;gsc=jjZVUgsAAAD4XXgyM-Ya7AOsEEqV9Zbb">Here</a> is the updated link to the source for this tutorial</p>
<p style="margin-bottom:0;">
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/edemmorny.wordpress.com/29/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/edemmorny.wordpress.com/29/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edemmorny.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edemmorny.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edemmorny.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edemmorny.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edemmorny.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edemmorny.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edemmorny.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edemmorny.wordpress.com/29/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edemmorny.wordpress.com/29/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edemmorny.wordpress.com/29/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=29&subd=edemmorny&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://edemmorny.wordpress.com/2008/01/24/bookmarkable-parameters-and-the-events-model-in-seam/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a863ee057fa55a68fef8fbf1a4d0d53?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edem</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/01/dep_list_old_edit.jpg" medium="image">
			<media:title type="html">old dept list</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/01/new_dep_edit.jpg" medium="image">
			<media:title type="html">new department creation</media:title>
		</media:content>

		<media:content url="http://edemmorny.files.wordpress.com/2008/01/dep_list_edit.jpg" medium="image">
			<media:title type="html">Updated list of depts</media:title>
		</media:content>
	</item>
		<item>
		<title>Annoying NetBeans 6.0 Facelets Support  Issue on Tomcat</title>
		<link>http://edemmorny.wordpress.com/2008/01/19/annoying-netbeans-60-facelets-support-issue-on-tomcat/</link>
		<comments>http://edemmorny.wordpress.com/2008/01/19/annoying-netbeans-60-facelets-support-issue-on-tomcat/#comments</comments>
		<pubDate>Sat, 19 Jan 2008 15:56:56 +0000</pubDate>
		<dc:creator>Edem Morny</dc:creator>
				<category><![CDATA[Seam]]></category>
		<category><![CDATA[Facelets]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[NetBeans 6.0]]></category>

		<guid isPermaLink="false">http://edemmorny.wordpress.com/2008/01/19/annoying-netbeans-60-facelets-support-issue-on-tomcat/</guid>
		<description><![CDATA[Yesterday i got a call from a good friend of mine who has been dipping his fingers into JSF a bit. He&#8217;d decided to jump ship to using JSF on XHTML files, a technology known as Facelets. So he goes to download NetBeans 6.0 Facelets support plugin and installs it.
After developing a simple facelets page, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=25&subd=edemmorny&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Yesterday i got a call from a good friend of mine who has been dipping his fingers into JSF a bit. He&#8217;d decided to jump ship to using JSF on XHTML files, a technology known as Facelets. So he goes to download NetBeans 6.0 Facelets support plugin and installs it.</p>
<p>After developing a simple facelets page, he decides to deploy it to Tomcat 6.0.14 only to get BIG FAT class loader exceptions. What better way to treat a sceptic who is just getting into the game of web development in Java. These are the kind of things that can be so annoying about doing something in Java. Being a Seam advocate and user, I didn&#8217;t immediately realise what could have been the problem, since my Seam applications run fine using the jars from Seam.</p>
<p>After doodling around and making some changes to jars that came with the Facelets support, i just decided to ditch the jars from Facelets support and use my own. I picked the jars that come with Seam and VOILA! Problem solved. Makes me wonder if the guys who developed the plugin didn&#8217;t try to deploy it themselves AT LEAST to Tomcat before putting it out there. Anyways i just felt like putting up the solution to this simple but very annoying problem here for the sake of those who might try an introduction to Facelets.</p>
<p>Note that i got these jars from the JBoss Seam 2.0.GA&#8217;s lib folder. I can&#8217;t tell you where u can get them individually but downloading seam altogether will give you a change to start playing around with it if you haven&#8217;t started already.</p>
<p>Simply create a new Library in NetBeans by going to Tools-&gt;Libraries. I gave mine the name Facelets4Tomcat. Here are the jar files you need.</p>
<ul>
<li>commons-beanutils.jar</li>
<li>commons-collections.jar</li>
<li>commons-digester.jar</li>
<li>commons-logging.jar</li>
<li>jboss-el.jar</li>
<li>jsf-api.jar</li>
<li>jsf-facelets.jar</li>
<li>jsf-impl.jar</li>
</ul>
<p>This goes into your web.xml file.</p>
<p>&lt;context-param&gt;<br />
&lt;param-name&gt;com.sun.faces.validateXml&lt;/param-name&gt;<br />
&lt;param-value&gt;true&lt;/param-value&gt;<br />
&lt;/context-param&gt;<br />
&lt;context-param&gt;<br />
&lt;param-name&gt;javax.faces.DEFAULT_SUFFIX&lt;/param-name&gt;<br />
&lt;param-value&gt;.xhtml&lt;/param-value&gt;<br />
&lt;/context-param&gt;<br />
&lt;context-param&gt;<br />
&lt;param-name&gt;facelets.DEVELOPMENT&lt;/param-name&gt;<br />
&lt;param-value&gt;false&lt;/param-value&gt;<br />
&lt;/context-param&gt;<br />
&lt;context-param&gt;<br />
&lt;param-name&gt;facelets.SKIP_COMMENTS&lt;/param-name&gt;<br />
&lt;param-value&gt;true&lt;/param-value&gt;<br />
&lt;/context-param&gt;<br />
&lt;servlet&gt;<br />
&lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;<br />
&lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;<br />
&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<br />
&lt;/servlet&gt;</p>
<p>&lt;servlet-mapping&gt;<br />
&lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;<br />
&lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;<br />
&lt;/servlet-mapping&gt;<br />
&lt;session-config&gt;<br />
&lt;session-timeout&gt;<br />
30<br />
&lt;/session-timeout&gt;<br />
&lt;/session-config&gt;<br />
&lt;welcome-file-list&gt;<br />
&lt;welcome-file&gt;forward.jsp&lt;/welcome-file&gt;<br />
&lt;/welcome-file-list&gt;</p>
<p>If you want to add the Ajaxified RichFaces components then add the following from the same Seam lib folder.</p>
<ul>
<li>richfaces-api.jar</li>
<li>richfaces-ui.jar</li>
<li>richfaces-impl.jar</li>
</ul>
<p>And add these to the top of your web.xml file</p>
<p>&lt;filter&gt;<br />
&lt;display-name&gt;RichFaces Filter&lt;/display-name&gt;<br />
&lt;filter-name&gt;richfaces&lt;/filter-name&gt;<br />
&lt;filter-class&gt;org.ajax4jsf.Filter&lt;/filter-class&gt;<br />
&lt;/filter&gt;<br />
&lt;filter-mapping&gt;<br />
&lt;filter-name&gt;richfaces&lt;/filter-name&gt;<br />
&lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;<br />
&lt;/filter-mapping&gt;<br />
&lt;context-param&gt;<br />
&lt;param-name&gt;org.ajax4jsf.SKIN&lt;/param-name&gt;<br />
&lt;param-value&gt;classic&lt;/param-value&gt;<br />
&lt;/context-param&gt;</p>
<p>You may use a different skin if you want. Check out the <a href="http://labs.jboss.com/jbossrichfaces/docs/index.html">documentation </a>for details</p>
<p>You may then add the library you created to your project by right clicking your web project and selecting &#8220;Properties&#8221;. At Libraries, click &#8220;Add Library&#8221; and selected the library you just created. Make sure that the check box is enabled or else it will not put the jar files in the right location i.e. WEB-INF/lib.</p>
<p>Oh, and MAKE SURE that the Facelets support libraries are unchecked, or else you&#8217;ll be back to square 1.</p>
<p>Happy Faceleting.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/edemmorny.wordpress.com/25/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/edemmorny.wordpress.com/25/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/edemmorny.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/edemmorny.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/edemmorny.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/edemmorny.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/edemmorny.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/edemmorny.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/edemmorny.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/edemmorny.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/edemmorny.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/edemmorny.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=edemmorny.wordpress.com&blog=2250651&post=25&subd=edemmorny&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://edemmorny.wordpress.com/2008/01/19/annoying-netbeans-60-facelets-support-issue-on-tomcat/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a863ee057fa55a68fef8fbf1a4d0d53?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Edem</media:title>
		</media:content>
	</item>
	</channel>
</rss>