<?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; Validator</title>
	<atom:link href="http://dominikdorn.com/tag/validator/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>XHTML strict &amp; OL start=&#8221;xx&#8221;</title>
		<link>http://dominikdorn.com/2010/04/xhtml-strict-ol-start/</link>
		<comments>http://dominikdorn.com/2010/04/xhtml-strict-ol-start/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 11:53:19 +0000</pubDate>
		<dc:creator>Dominik Dorn</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[strict]]></category>
		<category><![CDATA[valid]]></category>
		<category><![CDATA[Validator]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://dominikdorn.com/?p=287</guid>
		<description><![CDATA[This little post shows how to replace the start attribute of the ol tag in XHTML STRICT pages to validate again!]]></description>
			<content:encoded><![CDATA[<p>In XHTML strict, the ol-tag does not have the attribute start. </p>
<p>To get this working again, simply create a css-class</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.counterList</span> li <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.counterList</span> li<span style="color: #3333ff;">:before </span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span> counter<span style="color: #00AA00;">&#40;</span>start<span style="color: #00AA00;">&#41;</span> <span style="color: #ff0000;">&quot;. &quot;</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">counter-increment</span><span style="color: #00AA00;">:</span> start<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>and surround your list with a tag like this</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class='counterList&gt;
&lt;ol style=&quot;counter-reset: start 4&quot;&gt;
&lt;li&gt;this will be item 5&lt;/li&gt;
&lt;li&gt;this will be item 6&lt;/li&gt;
...
&lt;/ol&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p>I got this idea from http://www.timrivera.com/tests/ol-start.html </p>
]]></content:encoded>
			<wfw:commentRss>http://dominikdorn.com/2010/04/xhtml-strict-ol-start/feed/</wfw:commentRss>
		<slash:comments>0</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>
	</channel>
</rss>

