<?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>dominikdorn.com &#187; Facelets</title>
	<atom:link href="http://dominikdorn.com/tag/facelets/feed/" rel="self" type="application/rss+xml" />
	<link>http://dominikdorn.com</link>
	<description>shit happens ;)</description>
	<lastBuildDate>Tue, 03 Jan 2012 19:47:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>JSF Components &#8211; The entity &#8220;uuml&#8221; was referenced, but not declared</title>
		<link>http://dominikdorn.com/2010/10/jsf-components-entity-referenced-not-declared/</link>
		<comments>http://dominikdorn.com/2010/10/jsf-components-entity-referenced-not-declared/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 15:21:54 +0000</pubDate>
		<dc:creator>Dominik Dorn</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[Facelets]]></category>
		<category><![CDATA[javaee6]]></category>
		<category><![CDATA[JSF2]]></category>

		<guid isPermaLink="false">http://dominikdorn.com/?p=348</guid>
		<description><![CDATA[Shows how to use html entities in a JSF 2 Facelets Composite Component]]></description>
			<content:encoded><![CDATA[<p>Today I created a custom <strong>JSF 2 Composite Component</strong>, but <strong>Mojarra</strong> threw an error on me, when I tried to use a German <strong>Umlaut</strong> like <strong>&amp;uuml;</strong> in my markup, like this</p>
<h1>HTTP Status 500 -</h1>
<hr /><strong>type</strong> Exception report</p>
<p><strong>message</strong></p>
<p><strong>description</strong>The server encountered an internal error () that prevented it from fulfilling this request.</p>
<p><strong>exception</strong></p>
<pre>javax.servlet.ServletException: javax.servlet.ServletException: javax.faces.view.facelets.FaceletException: Error Parsing /resources/sg/uploadedDoc.xhtml: Error Traced[line: 45] The entity "uuml" was referenced, but not declared.</pre>
<p><strong>root cause</strong></p>
<pre>javax.servlet.ServletException: javax.faces.view.facelets.FaceletException: Error Parsing /resources/sg/uploadedDoc.xhtml: Error Traced[line: 45] The entity "uuml" was referenced, but not declared.</pre>
<p><strong>root cause</strong></p>
<pre>java.util.concurrent.ExecutionException: javax.faces.view.facelets.FaceletException: Error Parsing /resources/sg/uploadedDoc.xhtml: Error Traced[line: 45] The entity "uuml" was referenced, but not declared.</pre>
<p><strong>root cause</strong></p>
<pre>javax.faces.view.facelets.FaceletException: Error Parsing /resources/sg/uploadedDoc.xhtml: Error Traced[line: 45] The entity "uuml" was referenced, but not declared.</pre>
<p><strong>note</strong> <span style="text-decoration: underline;">The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.0.1 logs.</span></p>
<hr />
<h3>GlassFish Server Open Source Edition 3.0.1</h3>
<hr />The reason this happened is, that I referenced an entity &#8220;uuml;&#8221; in a xml document where it is not defined.<br />
XML basically just supports a few build-in entities, like &#8220;amp;&#8221; &#8220;quot;&#8221;, &#8220;apos;&#8221;, &#8220;lt;&#8221; and &#8220;gt;&#8221;.</p>
<p>To let the SAX-Parser know which additional entities I wanted to use, I simply added the XHTML 1.1 DOCTYPE to the head of the document.<br />
My Component now looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span>
<span style="color: #00bbdd;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:h</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/jsf/html&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:f</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/jsf/core&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:ui</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/jsf/facelets&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns:composite</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/jsf/composite&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;composite:interface<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
....
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/composite:interface<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;composite:implementation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
.... text <span style="color: #ddbb00;">&amp;Uuml;</span>bermorgen ist auch noch ein Tag ... text
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/composite:implementation<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Hope this helps some of you out there. </p>
]]></content:encoded>
			<wfw:commentRss>http://dominikdorn.com/2010/10/jsf-components-entity-referenced-not-declared/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using complex urls &amp; regular expressions with PrettyFaces</title>
		<link>http://dominikdorn.com/2010/03/complex-urls-regular-expressions-validators-prettyfaces/</link>
		<comments>http://dominikdorn.com/2010/03/complex-urls-regular-expressions-validators-prettyfaces/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 20:15:24 +0000</pubDate>
		<dc:creator>Dominik Dorn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaEE6]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Facelets]]></category>
		<category><![CDATA[JavaEE]]></category>
		<category><![CDATA[JSF2]]></category>
		<category><![CDATA[PrettyFaces]]></category>
		<category><![CDATA[Regex]]></category>
		<category><![CDATA[Validator]]></category>

		<guid isPermaLink="false">http://dominikdorn.com/?p=249</guid>
		<description><![CDATA[In this post you will learn how to match complex urls with regular expressions and PrettyFaces in JSF2 Web Applications.]]></description>
			<content:encoded><![CDATA[<p>If you like to construct complex &#038; pretty urls with JSF2 &#038; PrettyFaces, you might be interested in the following few lines of code.</p>
<p>In our example, we want to match a URL like this one</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;">http://www.studyguru.eu/at/tuwien/184.153--Entwurfsmethoden-fuer-verteilte-Systeme</pre></td></tr></table></div>

<p>Previously I tried to match it with a PrettyFaces Pattern/Regex like this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">       <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pattern</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;/([a-z]{2})/([a-z0-9\-_]*)/([a-z0-9\-_\.]*)\-\-.*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>But thankfully, PrettyFaces >2.0.4 supports directly populating the RequestParams! </p>
<p>Configure your pretty-config like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pretty-config</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://ocpsoft.com/prettyfaces/2.0.4&quot;</span></span>
<span style="color: #009900;">               <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span>
<span style="color: #009900;">               <span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://ocpsoft.com/prettyfaces/2.0.4</span>
<span style="color: #009900;">                http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-2.0.4.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
....
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url-mapping</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;coursePage&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;pattern</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;/#{countryCode}/#{uniShortName}/#{courseId}--.*&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;view-id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/path/to/coursePage.xhtml<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/view-id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
....</pre></td></tr></table></div>

<p>and use JSF2&#8242;s viewParams like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE html</span>
<span style="color: #00bbdd;">        PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span>
<span style="color: #00bbdd;">        &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span> <span style="color: #000066;">xml:lang</span>=<span style="color: #ff0000;">&quot;en&quot;</span> <span style="color: #000066;">lang</span>=<span style="color: #ff0000;">&quot;en&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">xmlns:h</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/jsf/html&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">xmlns:f</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/jsf/core&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">xmlns:pretty</span>=<span style="color: #ff0000;">&quot;http://ocpsoft.com/prettyfaces&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">xmlns:ui</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/jsf/facelets&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">xmlns:p</span>=<span style="color: #ff0000;">&quot;http://primefaces.prime.com.tr/ui&quot;</span></span>
<span style="color: #009900;">        <span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:metadata<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:viewParam</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;countryCodeId&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">requiredMessage</span>=<span style="color: #ff0000;">&quot;Kein Land spezifiziert&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;countryCode&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#{coursePageBean.countryCode}&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:validateRegex</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;([a-z]{2})&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:viewParam<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:viewParam</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;universityCodeId&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">requiredMessage</span>=<span style="color: #ff0000;">&quot;Keine Hochschule spezifiziert&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;uniShortName&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#{coursePageBean.universityCode}&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:validateRegex</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;([a-z0-9\-_]*)&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:viewParam<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:viewParam</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;courseIdId&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">requiredMessage</span>=<span style="color: #ff0000;">&quot;Keine KursId spezifiziert&quot;</span></span>
<span style="color: #009900;">                 <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;courseId&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#{coursePageBean.courseId}&quot;</span></span>
<span style="color: #009900;">            <span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:validateRegex</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;([a-z0-9\-_\.]*)&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:viewParam<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:event</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;preRenderView&quot;</span> <span style="color: #000066;">listener</span>=<span style="color: #ff0000;">&quot;#{coursePageBean.populate}&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/f:metadata<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>coursePage<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h1<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
countryCode #{ coursePageBean.countryCode} <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
courseId #{coursePageBean.courseId}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
universityCode #{coursePageBean.universityCode}<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;br</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Voila! You now can match complex urls with PrettyFaces and apply all your custom validators<br />
to your Pretty URL <img src='http://dominikdorn.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://dominikdorn.com/2010/03/complex-urls-regular-expressions-validators-prettyfaces/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Spring Security Facelets/JSF 2.0 Taglib released in v0.3</title>
		<link>http://dominikdorn.com/2010/01/spring-security-faceletsjsf-2-0-taglib-released-in-v0-3/</link>
		<comments>http://dominikdorn.com/2010/01/spring-security-faceletsjsf-2-0-taglib-released-in-v0-3/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 15:42:10 +0000</pubDate>
		<dc:creator>Dominik Dorn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaEE6]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Facelets]]></category>
		<category><![CDATA[Spring]]></category>
		<category><![CDATA[Spring-Security]]></category>

		<guid isPermaLink="false">http://dominikdorn.com/?p=173</guid>
		<description><![CDATA[The Spring Security Facelets/JSF 2.0 Taglib got released in version 0.3. CHANGES: Replaced roles.isEmpty() with roles.equals(&#8220;&#8221;) to allow usage with Java 5 Adopted taglib for usage with Spring 3/Spring Security 3 final removed faces-config.xml in taglibs for jsf 1.2 as it prevented deploying in some scenarios Fetch it from the Project Homepage]]></description>
			<content:encoded><![CDATA[<p>The Spring Security Facelets/JSF 2.0 Taglib got released in version 0.3.</p>
<p>CHANGES:</p>
<ul>
<li>Replaced roles.isEmpty() with roles.equals(&#8220;&#8221;) to allow usage with Java 5</li>
<li>Adopted taglib for usage with Spring 3/Spring Security 3 final</li>
<li>removed faces-config.xml in taglibs for jsf 1.2 as it prevented deploying in some scenarios</li>
</ul>
<p>Fetch it from the <a href="http://code.google.com/p/spring-security-facelets-taglib/" target="_blank">Project Homepage</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dominikdorn.com/2010/01/spring-security-faceletsjsf-2-0-taglib-released-in-v0-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FileUpload with JSF 2 and Servlet 3.0</title>
		<link>http://dominikdorn.com/2009/12/fileupload-with-jsf-2-and-servlet-3-0/</link>
		<comments>http://dominikdorn.com/2009/12/fileupload-with-jsf-2-and-servlet-3-0/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 23:11:28 +0000</pubDate>
		<dc:creator>Dominik Dorn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaEE6]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Facelets]]></category>
		<category><![CDATA[JavaEE]]></category>
		<category><![CDATA[JSF2]]></category>
		<category><![CDATA[Servlet 3.0]]></category>

		<guid isPermaLink="false">http://dominikdorn.com/?p=169</guid>
		<description><![CDATA[Facelets Taglib for JSF2 and Servlet 3.0]]></description>
			<content:encoded><![CDATA[<p>As I had serious problems with FileUpload and the existing &#8220;solutions&#8221;, mainly Tomahawk, MyFaces, RichFaces, PrimeFaces, etc. which are all not 100% ready for JSF 2.</p>
<p>I created a taglib based on the code of <a href="http://balusc.blogspot.com">BalusC</a>.<br />
You can find the <a href="http://github.com/domdorn/fileUploadServlet3JSF2">Taglib on Github</a></p>
<p>The source code is based on these two posts:</p>
<ol>
<li><a href="http://balusc.blogspot.com/2009/12/uploading-files-in-servlet-30.html">Uploading files in Servlet 3.0</a></li>
<li><a href="http://balusc.blogspot.com/2009/12/uploading-files-with-jsf-20-and-servlet.html" target="_blank">Uploading files with JSF 2.0 and Servlet 3.0</a></li>
</ol>
<p>Simply check out the code with git</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">git</span> clone http:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>domdorn<span style="color: #000000; font-weight: bold;">/</span>fileUploadServlet3JSF2.git</pre></td></tr></table></div>

<p>then install the taglib with</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">mvn clean compile <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>and import it into your maven project like this</p>
<pre>
net.balusc
fileUploadServlet3JSF2
1.0-SNAPSHOT
</pre>
<p>You can then use the taglib in your Facelets files like this:</p>
<p>Upload.xhtml</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE html</span>
<span style="color: #00bbdd;">PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span>
<span style="color: #00bbdd;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;html</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span> <span style="color: #000066;">xml:lang</span>=<span style="color: #ff0000;">&quot;en&quot;</span> <span style="color: #000066;">lang</span>=<span style="color: #ff0000;">&quot;en&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xmlns:h</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/jsf/html&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xmlns:f</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/jsf/core&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xmlns:ui</span>=<span style="color: #ff0000;">&quot;http://java.sun.com/jsf/facelets&quot;</span></span>
<span style="color: #009900;">	<span style="color: #000066;">xmlns:hh</span>=<span style="color: #ff0000;">&quot;http://balusc.net/jsf/html&quot;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>FileUploadTest<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h:head<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:form</span> <span style="color: #000066;">prependId</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:messages</span> <span style="color: #000066;">globalOnly</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;messages&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:panelGrid</span> <span style="color: #000066;">columns</span>=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label</span> <span style="color: #000066;">for</span>=<span style="color: #ff0000;">&quot;someText&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				SomeText:
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:inputText</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;someText&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#{uploadBean.someText}&quot;</span> <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:ajax</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;blur&quot;</span> <span style="color: #000066;">render</span>=<span style="color: #ff0000;">&quot;someText someTextMessage&quot;</span> <span style="color: #000066;">execute</span>=<span style="color: #ff0000;">&quot;@this&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h:inputText<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:message</span> <span style="color: #000066;">for</span>=<span style="color: #ff0000;">&quot;someText&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;someTextMessage&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;label</span> <span style="color: #000066;">for</span>=<span style="color: #ff0000;">&quot;filenameText&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			Filename:
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/label<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:inputText</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;filenameText&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#{uploadBean.filename}&quot;</span> <span style="color: #000066;">required</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:ajax</span> <span style="color: #000066;">event</span>=<span style="color: #ff0000;">&quot;blur&quot;</span> <span style="color: #000066;">render</span>=<span style="color: #ff0000;">&quot;filenameText filenameTextMessage&quot;</span> <span style="color: #000066;">execute</span>=<span style="color: #ff0000;">&quot;@this&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h:inputText<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:message</span> <span style="color: #000066;">for</span>=<span style="color: #ff0000;">&quot;filenameText&quot;</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;filenameTextMessage&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h:panelGrid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h:form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:form</span> <span style="color: #000066;">enctype</span>=<span style="color: #ff0000;">&quot;multipart/form-data&quot;</span> <span style="color: #000066;">prependId</span>=<span style="color: #ff0000;">&quot;false&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:panelGrid</span> <span style="color: #000066;">columns</span>=<span style="color: #ff0000;">&quot;3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:outputLabel</span> <span style="color: #000066;">for</span>=<span style="color: #ff0000;">&quot;uploadedFile&quot;</span> <span style="color: #000066;">rendered</span>=<span style="color: #ff0000;">&quot;#{empty uploadBean.file}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				Input File:
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h:outputLabel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;hh:inputFile</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;uploadedFile&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;#{uploadBean.file}&quot;</span> <span style="color: #000066;">rendered</span>=<span style="color: #ff0000;">&quot;#{empty uploadBean.file}&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;f:validator</span> <span style="color: #000066;">validatorId</span>=<span style="color: #ff0000;">&quot;fileValidator&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/hh:inputFile<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:message</span> <span style="color: #000066;">for</span>=<span style="color: #ff0000;">&quot;uploadedFile&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h:panelGrid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h:commandButton</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">action</span>=<span style="color: #ff0000;">&quot;#{uploadBean.submit}&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h:form<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/body<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/html<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>The bean:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
</pre></td><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.dominikdorn.simpleFileUpload.beans</span><span style="color: #339933;">;&lt;/</span>code<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.faces.bean.ManagedBean</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.faces.bean.RequestScoped</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.faces.bean.SessionScoped</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.faces.bean.ViewScoped</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.File</span><span style="color: #339933;">;</span>
&nbsp;
@ViewScoped
@ManagedBean
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> UploadBean <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">File</span> file<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> filename<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getFilename<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">return</span> filename<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setFilename<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> filename<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;binding filename&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">filename</span> <span style="color: #339933;">=</span> filename<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> submit<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;calling submit&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>file <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">filename</span> <span style="color: #339933;">=</span> file.<span style="color: #006633;">getName</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;processed&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// do what you want with the file</span>
<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;yeah&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> UploadBean<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">File</span> getFile<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">return</span> file<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setFile<span style="color: #009900;">&#40;</span><span style="color: #003399;">File</span> file<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">file</span> <span style="color: #339933;">=</span> file<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> someText<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> getSomeText<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">return</span> someText<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setSomeText<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> someText<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #003399;">System</span>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;binding someText&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">someText</span> <span style="color: #339933;">=</span> someText<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://dominikdorn.com/2009/12/fileupload-with-jsf-2-and-servlet-3-0/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>JSF-Validators for Pretty-URLs!</title>
		<link>http://dominikdorn.com/2009/11/jsf-validators-for-pretty-urls/</link>
		<comments>http://dominikdorn.com/2009/11/jsf-validators-for-pretty-urls/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 10:29:50 +0000</pubDate>
		<dc:creator>Dominik Dorn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Facelets]]></category>
		<category><![CDATA[PrettyFaces]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://dominikdorn.com/?p=124</guid>
		<description><![CDATA[As Lincoln Baxter posted recently in the PrettyFaces-Blog, the upcomming PrettyFaces 2.0.3 will include support for JSF-Validators within PrettyFaces, allowing to reuse the already existing Validators infrastructure for Pretty URL Mapping (SEO Stuff etc.) Nice one Lincoln!]]></description>
			<content:encoded><![CDATA[<p>As <a title="Lincoln Baxter" href="http://twitter.com/lincolnthree" target="_blank">Lincoln Baxter</a> posted recently in the <a title="PrettyFaces Blog" href="http://ocpsoft.com/" target="_blank">PrettyFaces-Blog</a>, the upcomming <a title="PrettyFaces Homepage + Download" href="http://ocpsoft.com/prettyfaces/" target="_blank">PrettyFaces 2.0.3 </a>will include <a title="JSF 2 URL Validation" href="http://ocpsoft.com/prettyfaces/docs/#validation" target="_blank">support for JSF-Validators within PrettyFaces</a>, allowing to reuse the already existing Validators infrastructure for Pretty URL Mapping (SEO Stuff etc.)</p>
<p>Nice one Lincoln!</p>
]]></content:encoded>
			<wfw:commentRss>http://dominikdorn.com/2009/11/jsf-validators-for-pretty-urls/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building JSF-2 Apps with Apache Maven 2</title>
		<link>http://dominikdorn.com/2009/10/building-jsf-2-apps-with-apache-maven-2/</link>
		<comments>http://dominikdorn.com/2009/10/building-jsf-2-apps-with-apache-maven-2/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 18:38:36 +0000</pubDate>
		<dc:creator>Dominik Dorn</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[Archetype]]></category>
		<category><![CDATA[Dependency]]></category>
		<category><![CDATA[Facelets]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://dominikdorn.com/?p=111</guid>
		<description><![CDATA[he team from Sun/the JSF Expert Group released a page showing what you need to add to your pom.xml to include jsf-2 in your maven project. Taken from https://javaserverfaces.dev.java.net/maven2, the required parts are: If you use Glassfish v3 or higher: 1 2 3 4 5 6 &#60;dependency&#62; &#60;groupId&#62;javax.faces&#60;/groupId&#62; &#60;artifactId&#62;jsf-api&#60;/artifactId&#62; &#60;version&#62;2.0&#60;/version&#62; &#60;scope&#62;provided&#60;/scope&#62; &#60;/dependency&#62; If you use [...]]]></description>
			<content:encoded><![CDATA[<p>he team from Sun/the JSF Expert Group released a page showing what you need to add to your pom.xml to include jsf-2 in your maven project.</p>
<p>Taken from <a href="https://javaserverfaces.dev.java.net/maven2 " target="_self">https://javaserverfaces.dev.java.net/maven2</a>, the required parts are:</p>
<p>If you use Glassfish v3 or higher:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>javax.faces<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>jsf-api<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>provided<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/scope<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>If you use Tomcat or Jetty (or any other non JEE6 compliant Servlet Container):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.sun.faces<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>jsf-api<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.0.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>com.sun.faces<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>jsf-impl<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.0.0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>&nbsp;</p>
<p>However, If you put the JBoss repository either in your <em>pom.xml</em> or your <em>~/.m2/settings.xml</em></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;">		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>jboss<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Jboss Maven Repository<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://repository.jboss.com/maven2/<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/repository<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>you can then use the following dependencies (which I think are more appropriate):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;">		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>javax.faces<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>jsf-api<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.0.0-FCS<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>javax.faces<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/groupId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>jsf-impl<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/artifactId<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2.0.0-FCS<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dependency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Also Sun provides some <a href="http://download.java.net/maven/2/javax/faces/jsf2-simple-example-archetype/" target="_blank">simple JSF-2 archetypes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dominikdorn.com/2009/10/building-jsf-2-apps-with-apache-maven-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Combining PrimeFaces Tooltip with h:message</title>
		<link>http://dominikdorn.com/2009/10/combining-primefaces-tooltip-with-hmessage/</link>
		<comments>http://dominikdorn.com/2009/10/combining-primefaces-tooltip-with-hmessage/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 17:26:35 +0000</pubDate>
		<dc:creator>Dominik Dorn</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[Facelets]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://dominikdorn.com/?p=100</guid>
		<description><![CDATA[Martin Ahrer, one of Austrians JSF geniuses shows a way how to integrate PrimeFaces ToolTip component with conditional rendering, only when validation errors occurred. Although I would have chosen a different approach (mainly extending the already existent h:message tag), Martins way works quite nice. Thanks Martin!]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.martinahrer.at">Martin Ahrer</a>, one of Austrians JSF geniuses shows a way how to integrate <a href="http://97.107.138.40:8080/prime-showcase/ui/tooltipGlobal.jsf">PrimeFaces ToolTip</a> component with <a href="http://www.martinahrer.at/blog/2009/10/20/jsf-challenge-2-control-rendering-of-ui-elements-based-on-validation-results/">conditional rendering, only when validation errors</a> occurred.  </p>
<p>Although I would have chosen a different approach<br />
(mainly extending the already existent h:message tag), Martins way works quite nice.<br />
Thanks Martin!</p>
]]></content:encoded>
			<wfw:commentRss>http://dominikdorn.com/2009/10/combining-primefaces-tooltip-with-hmessage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

