<?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>Hostylez &#187; Tips</title>
	<atom:link href="http://blog.hostylez.com/category/tips/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.hostylez.com</link>
	<description>Reveal yer trve dark attitude :3</description>
	<lastBuildDate>Tue, 26 Jan 2010 19:07:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>URL Rewriting avec Stripes</title>
		<link>http://blog.hostylez.com/tips/2009/04/15/url-rewriting-stripes</link>
		<comments>http://blog.hostylez.com/tips/2009/04/15/url-rewriting-stripes#comments</comments>
		<pubDate>Wed, 15 Apr 2009 20:58:19 +0000</pubDate>
		<dc:creator>Rykian</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[J2EE]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[Stripes]]></category>

		<guid isPermaLink="false">http://blog.hostylez.com/?p=72</guid>
		<description><![CDATA[Dans le cadre de mon stage, j'ai dû me mettre à Stripes afin de comprendre le fonctionnement de la plateforme actuelle.
Je souhaitait faire de la réécriture d'URL dans mes applications J2EE. Au cours de ma veille, je suis tombé sur UrlRewriteFilter, mais j'étais embêté du fait de devoir utiliser un filtre de plus sur mon [...]]]></description>
			<content:encoded><![CDATA[<p>Dans le cadre de mon stage, j'ai dû me mettre à <a title="Stripes Framework" href="http://www.stripesframework.org">Stripes</a> afin de comprendre le fonctionnement de la plateforme actuelle.</p>
<p>Je souhaitait faire de la réécriture d'URL dans mes applications <em>J2EE</em>. Au cours de ma veille, je suis tombé sur <a title="Filter J2EE pour la réécriture d'URL" href="http://tuckey.org/urlrewrite/">UrlRewriteFilter</a>, mais j'étais embêté du fait de devoir utiliser un filtre de plus sur mon application. Finalement, j'étais passé à côté de l'annotation <code>@UrlBinding</code> qui permettait de faire quasiment ce que je souhaitais au détail prêt que je devais terminé mes URLs par <code>.action</code>.</p>
<p>En fouillant un peu dans mon <em>web.xml</em>, j'étais tombé sur cette partie là :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;servlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>StripesDispatcher<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-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-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>*.action<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/servlet-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Pas de problèmes, je remplace la ligne 3 par</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;url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Or, petits problèmes en perspective, plantage du serveur, redirections en boucle sur les mêmes pages. Owned.</p>
<p>Petite recherche de la part d'un collègue et j'apprends l'existence de <code>DynamicMappingFilter</code> dans <em>Stripes</em>. On reprends notre <em>web.xml</em> et on copie ceci :</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;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DynamicMappingFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>net.sourceforge.stripes.controller.DynamicMappingFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DynamicMappingFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-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-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/*<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/url-pattern<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dispatcher<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>REQUEST<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dispatcher<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dispatcher<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>FORWARD<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dispatcher<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dispatcher<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>INCLUDE<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/dispatcher<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Et voilà, je peux mettre ce que je veux dans mes URLs !</p>
<p>Prochaine étape, pouvoir mettre des variables dans les <code>@UrlBinding</code> sans tout casser &gt;_&lt;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hostylez.com/tips/2009/04/15/url-rewriting-stripes/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connaître le nombre de ligne de code dans un dossier</title>
		<link>http://blog.hostylez.com/tips/2009/04/14/nombre-ligne-de-code-dans-un-dossier</link>
		<comments>http://blog.hostylez.com/tips/2009/04/14/nombre-ligne-de-code-dans-un-dossier#comments</comments>
		<pubDate>Tue, 14 Apr 2009 17:36:25 +0000</pubDate>
		<dc:creator>Rykian</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://blog.hostylez.com/?p=65</guid>
		<description><![CDATA[J'inaugure une nouvelle catégorie dans laquelle je noterais les différentes réponses à des problèmes que j'ai rencontré dans mes petites aventures journalières.
Aujourd'hui, j'ai dû apprendre à compter le nombre de ligne de code dans un projet Java et ne voyant pas comment faire sous Eclipse (et puis compter, ça semblait un peu compliqué :p), j'ai gentiment demandé [...]]]></description>
			<content:encoded><![CDATA[<p>J'inaugure une nouvelle catégorie dans laquelle je noterais les différentes réponses à des problèmes que j'ai rencontré dans mes petites aventures journalières.</p>
<p>Aujourd'hui, j'ai dû apprendre à compter le nombre de ligne de code dans un projet Java et ne voyant pas comment faire sous Eclipse (et puis compter, ça semblait un peu compliqué :p), j'ai gentiment demandé sur Twitter et la réponse est apparue quelques instant plus tard (merci <a title="Twitter de @Patoch_" href="http://twitter.com/Patoch_">@Patoch_</a> ;))</p>
<p>La réponse était <a title="[Bash] Compter le nombre de lignes de tous les fichiers d'un dossier" href="http://forum.ubuntu-fr.org/viewtopic.php?id=144457">ici</a>, soit :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> f <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> <span style="color: #660033;">-l</span></pre></div></div>

<p>Vous pouvez bien entendu utiliser tous les arguments de <em>find</em> pour préciser votre recherche, par exemple pour compter uniquement les fichiers dont l'extension est <em>.java</em> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-type</span> f <span style="color: #660033;">-name</span> <span style="color: #ff0000;">&quot;*.java&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> <span style="color: #660033;">-l</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.hostylez.com/tips/2009/04/14/nombre-ligne-de-code-dans-un-dossier/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
