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

<channel>
	<title>Benny's Blog &#187; seam</title>
	<atom:link href="http://blog.projectnibble.org/tag/seam/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.projectnibble.org</link>
	<description>House Of Code</description>
	<lastBuildDate>Fri, 13 Aug 2010 15:06:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>JSF is a diamond in the rough, you just need to make it shine</title>
		<link>http://blog.projectnibble.org/2009/05/24/jsf-is-a-diamond-in-the-rough-you-just-need-to-make-it-shine/</link>
		<comments>http://blog.projectnibble.org/2009/05/24/jsf-is-a-diamond-in-the-rough-you-just-need-to-make-it-shine/#comments</comments>
		<pubDate>Sun, 24 May 2009 13:30:53 +0000</pubDate>
		<dc:creator>Benny Bottema</dc:creator>
				<category><![CDATA[JSF/Facelets]]></category>
		<category><![CDATA[PrettyFaces]]></category>
		<category><![CDATA[a4j]]></category>
		<category><![CDATA[facelets]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[richfaces]]></category>
		<category><![CDATA[seam]]></category>
		<category><![CDATA[tomahawk]]></category>

		<guid isPermaLink="false">http://blog.projectnibble.org/?p=108</guid>
		<description><![CDATA[[RE: JSF – Still pretty much a steaming pile of donkey turd] &#8211; I was replying to Wille Faler’s post about why JSF sucks, when the comment was getting too large, so I made it into a post on my own blog. JSF is hard to learn yes, but in my opinion it doesn&#8217;t suck [...]]]></description>
			<content:encoded><![CDATA[<div style="color:#999999">
<p>[RE: JSF – Still pretty much a steaming pile of donkey turd] &#8211; I was replying to <a href="http://faler.wordpress.com/2007/03/13/jsf-still-pretty-much-a-steaming-pile-of-donkey-turd/">Wille Faler’s post about why JSF sucks</a>, when the comment was getting too large, so I made it into a post on my own blog.</p>
</div>
<hr />
<p><b>JSF is hard to learn yes, but in my opinion it doesn&#8217;t suck as bad as Wille says. All the points Wille mentions can be solved by certain libraries or write-once reusable solutions (I&#8217;ve included my &#8216;magical&#8217; combination of frameworks on the bottom). JSF is a diamond in the rough, you just need to make it shine.</b></p>
<p><span id="more-108"></span></p>
<h3>The devil is in the details</h3>
<p>There are a couple of pitfalls you need to know about with JSF. It&#8217;s all really a matter of having read a good book about JSF that points them out, or having learned them the hard way. Luckily I&#8217;ve had some guidance by experienced colleagues of mine; I&#8217;m guessing that&#8217;s the missing factor in Wille&#8217;s situation.</p>
<p>Referring to the pitfalls you need to know about, I&#8217;m talking about the common beginner&#8217;s problems like using JSTL c:tags that cause havoc when combined with those of jsf and facelets. I&#8217;m talking about the Ajax4Jsf details as Wille mentioned: once you know what to use it&#8217;s easy. Those 48 attributes? most of them are inherited and never used and you can forget about them, and that&#8217;s the learning curve. Once you know the right ones, it&#8217;s using exactly those, over and over again. And things like how you can incorporate Spring security and stuff like that. Another pitfall that comes to mind is how action=&#8221;" work quirky with navigation rules when using the array notation (action=&#8221;controller['action']&#8220;). And ofcourse there&#8217;s the issue of <a href="http://blog.projectnibble.org/2008/07/26/parameterized-jsf-facelets-validators/">parameterized JSF validators</a>, which needs some understanding. All pitfalls that can baffle a beginner or intermediate.</p>
<p>The thing with JSF is there are a number of little things that are hard to solve, but once you&#8217;re past that it <i>does</i> make you much more productive. You just have to have a solid base to start from each project. The pitfalls learning curve is definitely a downside of JSF, but <a href="http://blogs.jsfcentral.com/jsf2group/entry/jsf_2_primer">JSF 2.0</a> is in the making to solve all these issues.</p>
<h3>Bad performance or beginner&#8217;s mistake?</h3>
<p>Then there is this performance issue Wille mentions, where I think he missed the target: JSF does not have to be slow at all. It really depends on how you treat your backing beans. JSF has the weird tendency to call setters/getters multiple times, which seems utterly pointless (it&#8217;s related to resolving valuebindings in nested components). I&#8217;ve made the mistake before to directly retrieve values from a controller/service in my views instead of a static model (backing bean): this is what makes things slow. JSF in itself isn&#8217;t that slow for a webapp: yes there are many redundant calls but we&#8217;re not dealing with a realtime simulation application, webapps do just fine. On a sidenote, it also depends on the implementation&#8230; JSF is a reference specification, while there are various implementations of the framework (IBM&#8217;s, Sun&#8217;s etc.)</p>
<h3>SEO friendly JSF?</h3>
<p>Ahh, but for the <a href="http://blog.projectnibble.org/2009/03/20/bookmarkable-and-seo-friendly-jsf/">JSF Search Engine Friendliness</a>. That&#8217;s solved too, somewhat. There&#8217;s is a framework called <a href="http://ocpsoft.com/prettyfaces/">PrettyFaces</a> which allows you to dynamically generate/interpret pretty GET urls with bean values. It&#8217;s a great framework that solves a common problem, but there still exists the problem that existing jsf/facelets/richfaces components are not generating SEO HTML code. That&#8217;s really the fault of the component makers, not JSF, though JSF definitely isn&#8217;t innocent with its POST obsession: PrettyFaces fixes at least that.</p>
<h3>Common sense: use frameworks to avoid most pitfalls</h3>
<p>Once you&#8217;ve got those kind of things down and use a good framework combo, JSF is straightforward. You won&#8217;t really need to know about the various phases and you can be very productive if you&#8217;ve set up the jsf/facelets components right. I&#8217;ve worked with JSF intensively for about a year now in various projects with various implementations and I hardly ever need to use phaselisteners and that sort of stuff. The rare cases where you do need them, you can define these things ones and reuse them in other projects. With this approach I&#8217;ve created a template project with some standard libraries, phaselisteners, security set up, facelets components etc. and I&#8217;m up and running in no time.</p>
<p>I haven&#8217;t sanitized or otherwise cleaned up the template project so I won&#8217;t put that up for the time being, but at least I can tell you what frameworks are in it by default. </p>
<ul>The magical combination that works for me and my colleagues: </p>
<li>JSF (MVC)</li>
<li>Facelets (Templating, use of XHTML)</li>
<li><a href="http://livedemo.exadel.com/richfaces-demo/richfaces/inputNumberSlider.jsf?c=inputNumberSlider&#038;tab=usage">Richfaces</a> (component suite)</li>
<li><a href="http://livedemo.exadel.com/richfaces-demo/richfaces/commandButton.jsf?c=commandButton&#038;tab=usage">Richfaces A4J</a> (Ajax support)</li>
<li><a href="http://myfaces.apache.org/tomahawk/index.html">Tomahawk</a> (only for <a href="http://myfaces.apache.org/tomahawk/extensionsFilter.html">file uploads with the Extensions Filter</a>)</li>
<li>PrettyFaces (for indexable GET urls)</li>
</ul>
<p>Now that I&#8217;ve mentioned these, you should check out <a href="http://www.jboss.com/products/seam/">JBoss Seam</a> as well, which basically is supposed to do everything the above libraries do combined, plus a couple of things more like solving the <a href="http://matthiaswessendorf.wordpress.com/2008/11/19/conversation-scope-and-jsf-or-your-favorite-web-framework/">conversational scope</a> issue. I haven&#8217;t worked with this framework myself though so I can&#8217;t speak from experience.</p>
<h3>Final note</h3>
<p>Although I agree JSF has some annoying pitfalls, shortcomings and a high learning curve, it&#8217;s been out there for enough time to pass for supplement frameworks to pop up from under the ground to solve most of these problems.</p>
<p>With the right combination, most classic counter arguments have become obsolete. Maybe it&#8217;s time for critics to take JSF as is: incomplete but ultimately making you more productive if combined with the right frameworks.</p>
<p><a href="http://blog.projectnibble.org/2009/05/24/jsf-is-a-diamond-in-the-rough-you-just-need-to-make-it-shine/trackback/">trackback</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.projectnibble.org/2009/05/24/jsf-is-a-diamond-in-the-rough-you-just-need-to-make-it-shine/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
