<?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>Blog4J &#187; Struts</title>
	<atom:link href="http://blog4j.free.fr/index.php/category/javaee/struts/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog4j.free.fr</link>
	<description>Articles et tutoriels sur la plateforme Java EE</description>
	<lastBuildDate>Sat, 11 Nov 2023 18:27:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Implémenter l&#8217;url rewriting sur un site en Java</title>
		<link>http://blog4j.free.fr/index.php/2008/03/05/implementer-lurl-rewriting-sur-un-site-en-java/</link>
		<comments>http://blog4j.free.fr/index.php/2008/03/05/implementer-lurl-rewriting-sur-un-site-en-java/#comments</comments>
		<pubDate>Wed, 05 Mar 2008 14:51:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[Struts]]></category>
		<category><![CDATA[jsf url rewriting]]></category>
		<category><![CDATA[URL Rewriting]]></category>
		<category><![CDATA[url rewriting en java]]></category>

		<guid isPermaLink="false">http://blog4j.free.fr/index.php/2008/03/05/implementer-lurl-rewriting-sur-un-site-en-java/</guid>
		<description><![CDATA[Comme expliqué sur ce billet, Soft EU Url Rewriter permet d&#8217;implémenter l&#8217;url rewriting sur un site en
Java. Voici un exemple concret de l&#8217;utilisation de cette librairie.
Il faut tout d&#8217;abord télécharger les deux archives .jar de Soft EU URL rewriter et les inclure dans le projet.
Il faut aussi déclarer la servlet de Soft EU URL Rewriter [...]

<script type="text/javascript">
SHARETHIS.addEntry({
    title: "Implémenter l&#8217;url rewriting sur un site en Java",
    url: "http://blog4j.free.fr/index.php/2008/03/05/implementer-lurl-rewriting-sur-un-site-en-java/"
});
</script>
    ]]></description>
			<content:encoded><![CDATA[<p>Comme expliqué <a href="http://blog4j.free.fr/index.php/2007/11/16/ecrivons-de-jolies-url-avec-softeu-url-rewriter/" title="url rewriting en java : soft eu url rewriter">sur ce billet</a>, Soft EU Url Rewriter permet d&#8217;implémenter <b>l&#8217;url rewriting</b> sur un <b>site en<br />
Java</b>. Voici un exemple concret de l&#8217;utilisation de cette librairie.</p>
<p>Il faut tout d&#8217;abord <a href="http://software.softeu.cz/rewriter/install.html" rel="nofollow" title="url rewriting en java : télécharger soft eu url rewriter">télécharger les deux archives .jar de Soft EU URL rewriter</a> et les inclure dans le projet.</p>
<p>Il faut aussi déclarer la servlet de Soft EU URL Rewriter dans le web.xml de l&#8217;application ainsi que les urls pour lesquelles il faut appliquer ce filtre :</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- url rewriter --&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;filter<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;filter-name<span style="font-weight: bold; color: black;">&gt;</span></span></span>RewriterFilter<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/filter-name<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;filter-class<span style="font-weight: bold; color: black;">&gt;</span></span></span>cz.softeu.rewriter.RewriterFilter<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/filter-class<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/filter<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;filter-mapping<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;filter-name<span style="font-weight: bold; color: black;">&gt;</span></span></span>RewriterFilter<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/filter-name<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;url-pattern<span style="font-weight: bold; color: black;">&gt;</span></span></span>/*<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/url-pattern<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/filter-mapping<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>Ici URL Rewriter testera toutes les urls de notre application.<br />
Pour ne filtrer que les pages JSF, il faut préciser l&#8217;url pattern suivant :</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;url-pattern<span style="font-weight: bold; color: black;">&gt;</span></span></span>*.jsf<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/url-pattern<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p><b>Cette librairie permet ensuite par l&#8217;intermédiaire d&#8217;un fichier de configuration (rewriter-config.xml) d&#8217;associer une adresse à afficher et une adresse réelle.</b> On peut, par exemple, définir dans notre fichier rewriter-config.xml :</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;rewriter-config</span> <span style="color: #000066;">xmlns:b</span>=<span style="color: #ff0000;">&quot;http://rewriter.softeu.cz/basic/&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;b:regex<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;from<span style="font-weight: bold; color: black;">&gt;</span></span></span>^/news/(.*)$<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/from<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;to<span style="font-weight: bold; color: black;">&gt;</span></span></span>/news.jsf?id=$1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/to<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/b:regex<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;b:regex</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;redirect&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;from<span style="font-weight: bold; color: black;">&gt;</span></span></span>^/categorie/([^\?]*)/(.*)$<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/from<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;to<span style="font-weight: bold; color: black;">&gt;</span></span></span>/displayCategories.jsf?id=$1<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/to<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/b:regex<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/rewriter-config<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p><b>Dans cet exemple, on redirige toutes les urls du type http://www.site.com/news/123/ vers http://www.site.com/news.jsf?id=123</b> et les urls du type http://www.site.com/categorie/nom-de-la-categorie(ou tout type de texte)/123/ vers http://www.site.com/displayCategories.jsf?id=123</p>
<p>La propriété type offre trois options pour la gestion des url :</p>
<p>- par défaut : la librairie va chercher la page dans le répertoire de l&#8217;application<br />
- redirect : une redirection est faîte sur la page<br />
- permanent-redirect : redirection de type HttpServletResponse.SC_MOVED_PERMANENTLY<br />
- temporary-redirect : redirection de type HttpServletResponse.SC_MOVED_TEMPORARILY</p>
<p>Il est donc maintenant possible de tester : en appelant l&#8217;url http://www.site.com/news/123/<br />
la page http://www.site.com/news.jsf?id=123 s&#8217;affichera ce qui est beaucoup mieux pour le<br />
référencement  naturel !</p>
<p><a href="http://sharethis.com/item?publisher=7b829c6f-b726-4687-8b67-8a213e6bef30&title=Impl%C3%A9menter+l%26%238217%3Burl+rewriting+sur+un+site+en+Java&url=http%3A%2F%2Fblog4j.free.fr%2Findex.php%2F2008%2F03%2F05%2Fimplementer-lurl-rewriting-sur-un-site-en-java%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog4j.free.fr/index.php/2008/03/05/implementer-lurl-rewriting-sur-un-site-en-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configurer le timeout des sessions en Java</title>
		<link>http://blog4j.free.fr/index.php/2008/02/15/configurer-le-timeout-des-sessions-en-java/</link>
		<comments>http://blog4j.free.fr/index.php/2008/02/15/configurer-le-timeout-des-sessions-en-java/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 15:32:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[Struts]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[timeout session en java]]></category>

		<guid isPermaLink="false">http://blog4j.free.fr/index.php/2008/02/15/configurer-le-timeout-des-sessions-en-java/</guid>
		<description><![CDATA[Un blog qui vous fait découvrir les gadgets hi tech les plus insolites et les plus innovants.
découvrez des soins de beauté naturels pour une peau éclatante de fraîcheur.
Audiblement vôtre : le blog qui vous fait découvrir le monde des livres audio Audible
Découvrez la liseuse Kindle, ses offres, ses livres et ses astuces !
le blog qui [...]

<script type="text/javascript">
SHARETHIS.addEntry({
    title: "Configurer le timeout des sessions en Java",
    url: "http://blog4j.free.fr/index.php/2008/02/15/configurer-le-timeout-des-sessions-en-java/"
});
</script>
    ]]></description>
			<content:encoded><![CDATA[<p><a href="https://gadgetmag.ziblogg.com/">Un blog qui vous fait découvrir les gadgets hi tech les plus insolites et les plus innovants.</a><br />
<a href="https://natural-beauty.ziblogg.com/">découvrez des soins de beauté naturels pour une peau éclatante de fraîcheur.</a><br />
<a href="https://audible.ziblogg.com/">Audiblement vôtre : le blog qui vous fait découvrir le monde des livres audio Audible</a><br />
<a href="https://kindle.ziblogg.com/">Découvrez la liseuse Kindle, ses offres, ses livres et ses astuces !</a><br />
<a href="https://jouons-ensemble.ziblogg.com/">le blog qui vous fait aimer les jeux de société. Tests, critiques, conseils et actualités pour tous les joueurs.</a><br />
<a href="https://animalia.ziblogg.com/">Le blog qui vous conseille sur les meilleurs accessoires pour votre animal de compagnie.</a><br />
<a href="https://www.ziblogg.com/">Plateforme de blogs réalisés par des auteurs indépendants.</a></p>
<p>Pour augmenter (ou diminuer) le timeout par défaut d&#8217;une session (qui est par défaut de 20 minutes), il suffit de préciser dans<br />
le web.xml :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="xml"> <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;session-config<span style="font-weight: bold; color: black;">&gt;</span></span></span>
     <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;session-timeout<span style="font-weight: bold; color: black;">&gt;</span></span></span>60<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/session-timeout<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/session-config<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Le timeout à préciser étant un temps en minutes.</p>
<p><a href="http://sharethis.com/item?publisher=7b829c6f-b726-4687-8b67-8a213e6bef30&title=Configurer+le+timeout+des+sessions+en+Java&url=http%3A%2F%2Fblog4j.free.fr%2Findex.php%2F2008%2F02%2F15%2Fconfigurer-le-timeout-des-sessions-en-java%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog4j.free.fr/index.php/2008/02/15/configurer-le-timeout-des-sessions-en-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ecrivons de jolies URL avec SoftEU URL Rewriter</title>
		<link>http://blog4j.free.fr/index.php/2007/11/16/ecrivons-de-jolies-url-avec-softeu-url-rewriter/</link>
		<comments>http://blog4j.free.fr/index.php/2007/11/16/ecrivons-de-jolies-url-avec-softeu-url-rewriter/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 12:31:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[Struts]]></category>
		<category><![CDATA[Glassfish]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[URL Rewriting]]></category>

		<guid isPermaLink="false">http://blog4j.free.fr/?p=3</guid>
		<description><![CDATA[Une étape indispensable dans la conception d&#8217;un site internet est le référencement naturel.
Un site bien référencé passe souvent par l&#8217;utilisation de l&#8217;url rewriting (mettre lien vers une définition).
Implémenter l&#8217;url rewriting sur une plateforme technique basée sur un serveur Apache est chose facile puisqu&#8217;il existe des tonnes de documentation sur le sujet.
Oui, mais comment fait on [...]

<script type="text/javascript">
SHARETHIS.addEntry({
    title: "Ecrivons de jolies URL avec SoftEU URL Rewriter",
    url: "http://blog4j.free.fr/index.php/2007/11/16/ecrivons-de-jolies-url-avec-softeu-url-rewriter/"
});
</script>
    ]]></description>
			<content:encoded><![CDATA[<p>Une étape indispensable dans la conception d&#8217;un site internet est le référencement naturel.</p>
<p>Un site bien référencé passe souvent par l&#8217;utilisation de l&#8217;url rewriting (mettre lien vers une définition).<br />
Implémenter l&#8217;url rewriting sur une plateforme technique basée sur un serveur Apache est chose facile puisqu&#8217;il existe des tonnes de documentation sur le sujet.</p>
<p>Oui, mais comment fait on pour implémenter l&#8217;url rewriting si on utilise pas Apache mais plutôt un serveur d&#8217;application tel que Glassfish par exemple ?</p>
<p>Voici la solution qui permettra à toutes vos applications web et sites internet développées en JSF, Struts ou avec les servlets/JSP : <a href="http://software.softeu.cz/rewriter/" title="URL rewriting Java JSP JSF Glassfish SoftEU Url Rewriter" target="_blank">SoftEU URL Rewriter</a>.<br />
Un outil bien utile et <a href="http://software.softeu.cz/rewriter/install.html" title="installation configuration softeu url rewriter" target="_blank">facile d&#8217;installation</a> développé sous licence LGPL qui permet par l&#8217;intermédiaire d&#8217;un fichier de configuration en XML de réécrire des URLs compréhensibles et indexable par les moteurs de recherche.</p>
<p><a href="http://sharethis.com/item?publisher=7b829c6f-b726-4687-8b67-8a213e6bef30&title=Ecrivons+de+jolies+URL+avec+SoftEU+URL+Rewriter&url=http%3A%2F%2Fblog4j.free.fr%2Findex.php%2F2007%2F11%2F16%2Fecrivons-de-jolies-url-avec-softeu-url-rewriter%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog4j.free.fr/index.php/2007/11/16/ecrivons-de-jolies-url-avec-softeu-url-rewriter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
