<?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; Java EE</title>
	<atom:link href="http://blog4j.free.fr/index.php/category/javaee/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>Liste des blogs</title>
		<link>http://blog4j.free.fr/index.php/2023/11/11/liens-personnalises/</link>
		<comments>http://blog4j.free.fr/index.php/2023/11/11/liens-personnalises/#comments</comments>
		<pubDate>Sat, 11 Nov 2023 10:35:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java EE]]></category>

		<guid isPermaLink="false">http://blog4j.free.fr/?p=81</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: "Liste des blogs",
    url: "http://blog4j.free.fr/index.php/2023/11/11/liens-personnalises/"
});
</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><a href="http://sharethis.com/item?publisher=7b829c6f-b726-4687-8b67-8a213e6bef30&title=Liste+des+blogs&url=http%3A%2F%2Fblog4j.free.fr%2Findex.php%2F2023%2F11%2F11%2Fliens-personnalises%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog4j.free.fr/index.php/2023/11/11/liens-personnalises/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installer PHP sur Glassfish avec Quercus</title>
		<link>http://blog4j.free.fr/index.php/2008/03/24/installer-php-sur-glassfish-avec-quercus/</link>
		<comments>http://blog4j.free.fr/index.php/2008/03/24/installer-php-sur-glassfish-avec-quercus/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 12:27:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Glassfish]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php sur glassfish]]></category>
		<category><![CDATA[php sur serveur java]]></category>
		<category><![CDATA[quercus]]></category>

		<guid isPermaLink="false">http://blog4j.free.fr/index.php/2008/03/24/installer-php-sur-glassfish-avec-quercus/</guid>
		<description><![CDATA[Quercus est une implémentation de PHP 5 en Java. Cette librairie permet donc d&#8217;utiliser du PHP sur n&#8217;importe quel serveur d&#8217;application Java. Voici comment l&#8217;installer et l&#8217;utiliser :
Il faut tout d&#8217;abord télécharger les .jar de Quercus (disponibles ici) .
Une fois téléchargés, il faut les inclure dans le dossier lib du domaine du serveur glassfish  [...]

<script type="text/javascript">
SHARETHIS.addEntry({
    title: "Installer PHP sur Glassfish avec Quercus",
    url: "http://blog4j.free.fr/index.php/2008/03/24/installer-php-sur-glassfish-avec-quercus/"
});
</script>
    ]]></description>
			<content:encoded><![CDATA[<p><a href="http://quercus.caucho.com/" title="PHP sur Glassfish avec Quercus" rel="nofollow">Quercus</a> est <strong>une implémentation de PHP 5 en Java</strong>. Cette librairie permet donc d&#8217;<strong>utiliser du PHP sur n&#8217;importe quel serveur d&#8217;application Java</strong>. Voici comment l&#8217;installer et l&#8217;utiliser :</p>
<p>Il faut tout d&#8217;abord <strong>télécharger les .jar de Quercus</strong> (disponibles <a href="http://blog.jdevelop.eu/downloads/glassfishphp/quercus.zip" rel="nofollow" title="PHP sur Glassfish avec Quercus">ici</a>) .</p>
<p>Une fois téléchargés, il faut <strong>les inclure dans le dossier lib du domaine du serveur glassfish</strong>  (par exemple dans le dossier [glassfish_home]/domains/domain1/lib/).</p>
<p>Il suffit ensuite d&#8217;<strong>implémenter la servlet de Quercus dans le fichier web.xml de l&#8217;application et d&#8217;en définir le mapping</strong>. Par exemple pour mapper toutes les pages en .php :</p>

<div class="wp_syntax"><div class="code"><pre class="xml">&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;servlet-name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Quercus Servlet<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/servlet-name<span style="font-weight: bold; color: black;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;servlet-class<span style="font-weight: bold; color: black;">&gt;</span></span></span>com.caucho.quercus.servlet.QuercusServlet<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/servlet-class<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;servlet-mapping<span style="font-weight: bold; color: black;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;servlet-name<span style="font-weight: bold; color: black;">&gt;</span></span></span>Quercus Servlet<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/servlet-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>*.php<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> 
&nbsp;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/servlet-mapping<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p>On peut maintenant créer une page PHP et l&#8217;inclure dans le répertoire contenant les pages web de l&#8217;application. Une fois le .war de l&#8217;appli déployé, la page PHP sera disponible sur le serveur Glassfish !</p>
<p><a href="http://sharethis.com/item?publisher=7b829c6f-b726-4687-8b67-8a213e6bef30&title=Installer+PHP+sur+Glassfish+avec+Quercus&url=http%3A%2F%2Fblog4j.free.fr%2Findex.php%2F2008%2F03%2F24%2Finstaller-php-sur-glassfish-avec-quercus%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog4j.free.fr/index.php/2008/03/24/installer-php-sur-glassfish-avec-quercus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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>Faire une redirection dans un bean JSF</title>
		<link>http://blog4j.free.fr/index.php/2008/03/03/faire-une-redirection-dans-un-bean-jsf/</link>
		<comments>http://blog4j.free.fr/index.php/2008/03/03/faire-une-redirection-dans-un-bean-jsf/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 10:43:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[redirection]]></category>
		<category><![CDATA[redirection bean JSF]]></category>
		<category><![CDATA[redirection dans un backing bean]]></category>
		<category><![CDATA[redirection dans un bean]]></category>

		<guid isPermaLink="false">http://blog4j.free.fr/index.php/2008/03/03/faire-une-redirection-dans-un-bean-jsf/</guid>
		<description><![CDATA[Voici une petite astuce qui permet de faire une redirection directement dans un backing bean de JSF :

FacesContext.getCurrentInstance&#40;&#41;
.getExternalContext&#40;&#41;
.redirect&#40;&#34;http://www.monSite.com&#34;&#41;;

Il suffit de récupérer l&#8217;instance en cours et d&#8217;utiliser la méthode redirect.


<script type="text/javascript">
SHARETHIS.addEntry({
    title: "Faire une redirection dans un bean JSF",
    url: "http://blog4j.free.fr/index.php/2008/03/03/faire-une-redirection-dans-un-bean-jsf/"
});
</script>
    ]]></description>
			<content:encoded><![CDATA[<p>Voici une petite astuce qui permet de faire une redirection directement dans un backing bean de JSF :</p>

<div class="wp_syntax"><div class="code"><pre class="java">FacesContext.<span style="color: #006600;">getCurrentInstance</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
.<span style="color: #006600;">getExternalContext</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
.<span style="color: #006600;">redirect</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;http://www.monSite.com&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p>Il suffit de récupérer l&#8217;instance en cours et d&#8217;utiliser la méthode redirect.</p>
<p><a href="http://sharethis.com/item?publisher=7b829c6f-b726-4687-8b67-8a213e6bef30&title=Faire+une+redirection+dans+un+bean+JSF&url=http%3A%2F%2Fblog4j.free.fr%2Findex.php%2F2008%2F03%2F03%2Ffaire-une-redirection-dans-un-bean-jsf%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog4j.free.fr/index.php/2008/03/03/faire-une-redirection-dans-un-bean-jsf/feed/</wfw:commentRss>
		<slash:comments>5</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>[Glassfish] Les &#171;&#160;alternate docroot&#160;&#187;</title>
		<link>http://blog4j.free.fr/index.php/2008/02/12/glassfish-les-alternate-docroot/</link>
		<comments>http://blog4j.free.fr/index.php/2008/02/12/glassfish-les-alternate-docroot/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 17:16:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Glassfish]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[glassfish alternate docroot]]></category>

		<guid isPermaLink="false">http://blog4j.free.fr/index.php/2008/02/12/glassfish-les-alternate-docroot/</guid>
		<description><![CDATA[Un &#171;&#160;alternate docroot&#160;&#187; permet de mapper un répertoire physique du serveur à une url.
Voici  un exemple concret qui permettra de mieux comprendre l&#8217;utilité de cette fonctionalité de Glassfish :
Un site dispose d&#8217;une section d&#8217;upload de photos. Ces photos sont enregistrées dans un répertoire /uploads de l&#8217;application.
Un gros problème se pose alors : une fois [...]

<script type="text/javascript">
SHARETHIS.addEntry({
    title: "[Glassfish] Les &#171;&#160;alternate docroot&#160;&#187;",
    url: "http://blog4j.free.fr/index.php/2008/02/12/glassfish-les-alternate-docroot/"
});
</script>
    ]]></description>
			<content:encoded><![CDATA[<p>Un &laquo;&nbsp;<b>alternate docroot</b>&nbsp;&raquo; permet de mapper un répertoire physique du serveur à une url.<br />
Voici  un exemple concret qui permettra de mieux comprendre l&#8217;utilité de cette fonctionalité de <b>Glassfish</b> :</p>
<p>Un site dispose d&#8217;une section d&#8217;upload de photos. Ces photos sont enregistrées dans un répertoire /uploads de l&#8217;application.<br />
Un gros problème se pose alors : une fois  que l&#8217;on redéploie l&#8217;application, le contenu du répertoire /uploads est vidé puisque les photos ne seront plus présentes dans le .war de l&#8217;application.<br />
La solution à ce problème est donc les <b>alternate docroot</b>.</p>
<p>On va pouvoir, dans le fichier sun-web.xml, définir un répertoire externe à l&#8217;application où l&#8217;on stockera les photos et y mapper une url. Ainsi, si on déclare dans notre sun-web.xml :</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;alternatedocroot_1&quot;</span> 
  <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;from=/uploads/*
  dir=/home/&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/property<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p><b>Glassfish</b> ira chercher toutes les photos qui auront l&#8217;url http://www.monSite.com/uploads/maPhoto.png dans le dossier /home/uploads/ du serveur.</p>
<p>A noter qu&#8217;il est possible de définir plusieurs <b>alternate docroot</b>, il faudra alors les déclarer sous la forme :</p>

<div class="wp_syntax"><div class="code"><pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;alternatedocroot_1&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;...&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/property<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;alternatedocroot_2&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;...&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/property<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;alternatedocroot_3&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;...&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/property<span style="font-weight: bold; color: black;">&gt;</span></span></span></pre></div></div>

<p><a href="http://sharethis.com/item?publisher=7b829c6f-b726-4687-8b67-8a213e6bef30&title=%5BGlassfish%5D+Les+%26laquo%3B%26nbsp%3Balternate+docroot%26nbsp%3B%26raquo%3B&url=http%3A%2F%2Fblog4j.free.fr%2Findex.php%2F2008%2F02%2F12%2Fglassfish-les-alternate-docroot%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog4j.free.fr/index.php/2008/02/12/glassfish-les-alternate-docroot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Glassfish] Gérer les virtual server</title>
		<link>http://blog4j.free.fr/index.php/2008/02/09/glassfish-gerer-les-virtual-server/</link>
		<comments>http://blog4j.free.fr/index.php/2008/02/09/glassfish-gerer-les-virtual-server/#comments</comments>
		<pubDate>Sat, 09 Feb 2008 19:35:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Glassfish]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[faire tourner glassfish port 80]]></category>
		<category><![CDATA[http listener glassfish]]></category>
		<category><![CDATA[virtual server glassfish]]></category>

		<guid isPermaLink="false">http://blog4j.free.fr/index.php/2008/02/09/glassfish-gerer-les-virtual-server/</guid>
		<description><![CDATA[Le virtual Hosting permet à un serveur Glassfish avec une même adresse IP de gérer plusieurs sites
Glassfish gère et différencie chaque site par son nom d&#8217;hôte.
Concrètement, le virtual hosting permet facilement de créer des serveurs virtuels avec pour chacun des noms d&#8217;hôtes différents.
Il est ensuite possible pour chaque serveur virtuel d&#8217;écouter sur un n° de [...]

<script type="text/javascript">
SHARETHIS.addEntry({
    title: "[Glassfish] Gérer les virtual server",
    url: "http://blog4j.free.fr/index.php/2008/02/09/glassfish-gerer-les-virtual-server/"
});
</script>
    ]]></description>
			<content:encoded><![CDATA[<p>Le <strong>virtual Hosting</strong> permet à un serveur <strong>Glassfish </strong>avec une même adresse IP de gérer plusieurs sites<br />
<strong>Glassfish </strong>gère et différencie chaque site par son nom d&#8217;hôte.</p>
<p>Concrètement, le <strong>virtual hosting</strong> permet facilement de créer des <strong>serveurs virtuels</strong> avec pour chacun des noms d&#8217;hôtes différents.<br />
Il est ensuite possible pour chaque serveur virtuel d&#8217;écouter sur un <strong>n° de port défini</strong> et de <strong>gérer la sécurité</strong> (SSL&#8230;).<br />
On pourra bien sûr, déployer des applications sur ce serveur virtuel.</p>
<p>Voici comment créer un nouveau domaine à l&#8217;aide de la console d&#8217;administration de glassfish :</p>
<p>Il faut tout d&#8217;abord se rendre dans la section virtual server ( HTTP Service &gt; Virtual Server ) et cliquer sur New.<br />
Une fois sur l&#8217;écran &laquo;&nbsp;New Virtual Server&nbsp;&raquo;, mettre <strong>un nom unique en id</strong> et préciser le nom d&#8217;hôte ou l&#8217;adresse IP de votre serveur dans la case <strong>Host</strong>.<br />
Laisser les autres propriétés par défaut et faire <strong>Ok</strong>.</p>
<p><img src="http://blog4j.free.fr/wp-includes/images/virtual-server-glassfish.PNG" alt="virtual server glassfish, faire tourner glassfish sur le port 80" /></p>
<p>Il faut ensuite créer un &laquo;&nbsp;<strong>http listener</strong>&nbsp;&raquo; qui interceptera les requêtes ( faire HTTP service &gt; HTTP Listeners).<br />
Cliquer sur <strong>New</strong>.<br />
Sur l&#8217;écran <strong>New HTTPListener</strong>, mettez un nom, l&#8217;ip du serveur ainsi que le n° de port sur lequel le listener doit interpréter les requêtes et sélectionnez le serveur virtuel précédemment créé. Faire <strong>Next</strong> puis sur l&#8217;écran suivant laisser les options par défaut et faire <strong>Finish</strong>.</p>
<p><img src="http://blog4j.free.fr/wp-includes/images/c1.PNG" alt="http listener glassfish, faire tourner glassfish sur le port 80" /></p>
<p>Il ne reste plus qu&#8217;a retourner sur notre serveur virtuel  ( dans HTTP Service &gt; Virtual Server ) pour y indiquer le nom de notre http-listener dans la case <strong>http-listener</strong>.</p>
<p><a href="http://sharethis.com/item?publisher=7b829c6f-b726-4687-8b67-8a213e6bef30&title=%5BGlassfish%5D+G%C3%A9rer+les+virtual+server&url=http%3A%2F%2Fblog4j.free.fr%2Findex.php%2F2008%2F02%2F09%2Fglassfish-gerer-les-virtual-server%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog4j.free.fr/index.php/2008/02/09/glassfish-gerer-les-virtual-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Glassfish : déployer une application à la racine</title>
		<link>http://blog4j.free.fr/index.php/2008/01/22/glassfish-deployer-une-application-a-la-racine/</link>
		<comments>http://blog4j.free.fr/index.php/2008/01/22/glassfish-deployer-une-application-a-la-racine/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 11:27:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Glassfish]]></category>
		<category><![CDATA[JSF]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[déployer application racine Glassfish]]></category>
		<category><![CDATA[déployer war à la racine]]></category>
		<category><![CDATA[serveur glassfish]]></category>

		<guid isPermaLink="false">http://blog4j.free.fr/index.php/2008/01/22/glassfish-deployer-une-application-a-la-racine/</guid>
		<description><![CDATA[L&#8217;interface d&#8217;administration de Glassfish permet de déployer très facilement des applications à partir d&#8217;archives (.war, .ear, .jar&#8230;).
Voici une petite astuce toute simple permettant de déployer son application directement à la racine, c&#8217;est à dire ne plus avoir :
http://www.monDomaine.com/MonApplication/page.jsf
mais
http://www.monDomaine.com/page.jsf
Il suffit, lors du déploiement,  de spécifier &#171;&#160;/&#160;&#187; pour le context root.
L&#8217;application sera alors disponible à partir [...]

<script type="text/javascript">
SHARETHIS.addEntry({
    title: "Glassfish : déployer une application à la racine",
    url: "http://blog4j.free.fr/index.php/2008/01/22/glassfish-deployer-une-application-a-la-racine/"
});
</script>
    ]]></description>
			<content:encoded><![CDATA[<p>L&#8217;interface d&#8217;administration de Glassfish permet de déployer très facilement des applications à partir d&#8217;archives (.war, .ear, .jar&#8230;).</p>
<p>Voici une petite astuce toute simple permettant de déployer son application directement à la racine, c&#8217;est à dire ne plus avoir :</p>
<p>http://www.monDomaine.com/MonApplication/page.jsf</p>
<p>mais</p>
<p>http://www.monDomaine.com/page.jsf</p>
<p>Il suffit, lors du déploiement,  de spécifier &laquo;&nbsp;/&nbsp;&raquo; pour le context root.<br />
L&#8217;application sera alors disponible à partir de  la racine du site.</p>
<p><a href="http://sharethis.com/item?publisher=7b829c6f-b726-4687-8b67-8a213e6bef30&title=Glassfish+%3A+d%C3%A9ployer+une+application+%C3%A0+la+racine&url=http%3A%2F%2Fblog4j.free.fr%2Findex.php%2F2008%2F01%2F22%2Fglassfish-deployer-une-application-a-la-racine%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog4j.free.fr/index.php/2008/01/22/glassfish-deployer-une-application-a-la-racine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[JSF] Récupérer l&#8217;index en cours dans un DataTable</title>
		<link>http://blog4j.free.fr/index.php/2008/01/14/jsf-recuperer-lindex-en-cours-dans-un-datatable/</link>
		<comments>http://blog4j.free.fr/index.php/2008/01/14/jsf-recuperer-lindex-en-cours-dans-un-datatable/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 16:10:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[DataTable]]></category>
		<category><![CDATA[en cours]]></category>
		<category><![CDATA[Index]]></category>
		<category><![CDATA[Item]]></category>
		<category><![CDATA[récupérer index datatable]]></category>
		<category><![CDATA[récupérer position datatable]]></category>

		<guid isPermaLink="false">http://blog4j.free.fr/index.php/2008/01/14/jsf-recuperer-lindex-en-cours-dans-un-datatable/</guid>
		<description><![CDATA[Cette astuce permet de récupérer l&#8217;index en cours d&#8217;un dataTable en JSF (le n° de chaque ligne) .
Il faut tout d&#8217;abord faire un &#171;&#160;binding&#160;&#187; du DataTable dans le Bean JSF associé à la vue :

public class MonBean &#123;
&#160;
	private HtmlDataTable myDataTable;

	public HtmlDataTable getMyDataTable() {
		return myDataTable;
	}
	public void setMyDataTable(HtmlDataTable myDataTable) {
		this.myDataTable = myDataTable;
	}
}
Et dans la page JSP ne [...]

<script type="text/javascript">
SHARETHIS.addEntry({
    title: "[JSF] Récupérer l&#8217;index en cours dans un DataTable",
    url: "http://blog4j.free.fr/index.php/2008/01/14/jsf-recuperer-lindex-en-cours-dans-un-datatable/"
});
</script>
    ]]></description>
			<content:encoded><![CDATA[<p>Cette astuce permet de récupérer l&#8217;index en cours d&#8217;un dataTable en JSF (le n° de chaque ligne) .</p>
<p>Il faut tout d&#8217;abord faire un &laquo;&nbsp;binding&nbsp;&raquo; du DataTable dans le Bean JSF associé à la vue :</p>

<div class="wp_syntax"><div class="code"><pre class="java"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MonBean <span style="color: #66cc66;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> HtmlDataTable myDataTable;</pre></div></div>

<p>	public HtmlDataTable getMyDataTable() {</p>
<p>		return myDataTable;<br />
	}</p>
<p>	public void setMyDataTable(HtmlDataTable myDataTable) {</p>
<p>		this.myDataTable = myDataTable;<br />
	}</p>
<p>}</pre>
<p>Et dans la page JSP ne pas oublier l'attribut binding sur le DataTable (pour lier le DataTable à celui du bean)  :</p>
<p><em>&lt;h:dataTable value="#{monBean.maListe}" var="item" binding="#{monBean.myDataTable}"&gt;</em></p>
<p><em>&lt;/h:dataTable&gt;</em><br />
Il est ensuite possible de récupérer l'index de chaque ligne grâce à la propriété ronIndex du DataTable :</p>
<p><em>&lt;h:outputText value=" #{monBean.myDataTable.rowIndex}" /&gt;</em></p>
<p><a href="http://sharethis.com/item?publisher=7b829c6f-b726-4687-8b67-8a213e6bef30&title=%5BJSF%5D+R%C3%A9cup%C3%A9rer+l%26%238217%3Bindex+en+cours+dans+un+DataTable&url=http%3A%2F%2Fblog4j.free.fr%2Findex.php%2F2008%2F01%2F14%2Fjsf-recuperer-lindex-en-cours-dans-un-datatable%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog4j.free.fr/index.php/2008/01/14/jsf-recuperer-lindex-en-cours-dans-un-datatable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Récupérer un bean session en JSF</title>
		<link>http://blog4j.free.fr/index.php/2008/01/08/recuperer-un-bean-session-en-jsf/</link>
		<comments>http://blog4j.free.fr/index.php/2008/01/08/recuperer-un-bean-session-en-jsf/#comments</comments>
		<pubDate>Tue, 08 Jan 2008 09:59:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[JSF]]></category>
		<category><![CDATA[Java EE]]></category>
		<category><![CDATA[bean session]]></category>
		<category><![CDATA[bean session JSF]]></category>
		<category><![CDATA[managed bean]]></category>
		<category><![CDATA[récupérer bean session JSF]]></category>
		<category><![CDATA[session bean]]></category>

		<guid isPermaLink="false">http://blog4j.free.fr/index.php/2008/01/08/recuperer-un-bean-session-en-jsf/</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: "Récupérer un bean session en JSF",
    url: "http://blog4j.free.fr/index.php/2008/01/08/recuperer-un-bean-session-en-jsf/"
});
</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>Le framework JSF offre trois possibilités de &laquo;&nbsp;scope&nbsp;&raquo; pour les managed beans :</p>
<ul>
<li>request (les valeurs des propriétés du bean sont sauvegadées le temps de la requête)</li>
<li>session (les valeurs sont mises en sessions)</li>
<li>application (les valeurs sont sauvegardées lors dez toute la durée de l&#8217;application)</li>
</ul>
<p>Lorsqu&#8217;un managed bean est mis en session, il peut être utile de le récupérer à partir d&#8217;un autre bean de l&#8217;application. Ceci peut être fait de cette façon :</p>
<p>FacesContext fc = FacesContext.getCurrentInstance();<br />
MonBean bean = (MonBean) fc.getExternalContext().getSessionMap().get(&nbsp;&raquo;nomDuBeanDansFacesConfig&nbsp;&raquo;);</p>
<p>Il suffit de récupérer le context de l&#8217;application, puis de récupérer le bean en session grâce à son nom déclaré dans le faces-config.xml.</p>
<p><a href="http://sharethis.com/item?publisher=7b829c6f-b726-4687-8b67-8a213e6bef30&title=R%C3%A9cup%C3%A9rer+un+bean+session+en+JSF&url=http%3A%2F%2Fblog4j.free.fr%2Findex.php%2F2008%2F01%2F08%2Frecuperer-un-bean-session-en-jsf%2F">ShareThis</a></p>]]></content:encoded>
			<wfw:commentRss>http://blog4j.free.fr/index.php/2008/01/08/recuperer-un-bean-session-en-jsf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
