<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Nicolas Richeton</title>
	
	<link>http://blog.richeton.com</link>
	<description>on Eclipse and Java development</description>
	<lastBuildDate>Thu, 14 Feb 2013 19:06:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/LeBlogDeNicolasRicheton" /><feedburner:info uri="leblogdenicolasricheton" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Esigate 4.0 released</title>
		<link>http://feedproxy.google.com/~r/LeBlogDeNicolasRicheton/~3/sto_zulD6n4/</link>
		<comments>http://blog.richeton.com/2013/02/14/esigate-4-0-released/#comments</comments>
		<pubDate>Thu, 14 Feb 2013 18:40:01 +0000</pubDate>
		<dc:creator>Nicolas Richeton</dc:creator>
				<category><![CDATA[ESIGate]]></category>

		<guid isPermaLink="false">http://blog.richeton.com/?p=1356</guid>
		<description><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2010/10/esigate.png" width="54" height="64" alt="ESIGate" title="ESIGate" /><br/>Esigate 4.0 has just been released, along with a new home page. Esigate is a reverse proxy, designed for integration purposes. A typical use is to merge PHP applications like Drupal, eZpublish, &#8230; with Java custom developments into a single, very fast web application. The new website lists some successful users, including the French national [...]]]></description>
				<content:encoded><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2010/10/esigate.png" width="54" height="64" alt="ESIGate" title="ESIGate" /><br/><p><a href="http://www.esigate.org">Esigate</a> 4.0 has just been released, along with a new home page.</p>
<p>Esigate is a reverse proxy, designed for integration purposes. A typical use is to merge PHP applications like <a href="http://www.drupal.org">Drupal</a>, <a href="http://www.ez.no">eZpublish</a>, &#8230; with Java custom developments into a single, very fast web application.</p>
<p>The new website lists some successful users, including the French national railway company, Capgemini, Smile and others companies and public institutions.<br />
We have more users to add to this list, but we are waiting for their authorization. Some of them can be found with simple google search <img src='http://blog.richeton.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . If you are an esigate user, please get in touch with us to have your logo and name added to the site.</p>
<p>This release introduces a standalone server (it no longer requires a servlet engine) and an extension API making it easier to add new features and change default behavior.</p>
<p>Apache HttpClient now replaces the previous custom HTTP cache implementation. We worked with HTTP client team during the last months to fix several issues which where affecting esigate.</p>
<p>More information and downloads on the new <a href="http://www.esigate.org">esigate website</a>.</p>
<img src="http://feeds.feedburner.com/~r/LeBlogDeNicolasRicheton/~4/sto_zulD6n4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.richeton.com/2013/02/14/esigate-4-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.richeton.com/2013/02/14/esigate-4-0-released/</feedburner:origLink></item>
		<item>
		<title>Solve ClassNotFoundExceptions with Maven war projects on Eclipse</title>
		<link>http://feedproxy.google.com/~r/LeBlogDeNicolasRicheton/~3/inLC-53Kfrc/</link>
		<comments>http://blog.richeton.com/2012/08/31/solve-classnotfoundexceptions-with-maven-war-projects-on-eclipse/#comments</comments>
		<pubDate>Fri, 31 Aug 2012 06:51:27 +0000</pubDate>
		<dc:creator>Nicolas Richeton</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://blog.richeton.com/?p=1250</guid>
		<description><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2008/05/eclipse-642.png" width="64" height="37" alt="Eclipse" title="Eclipse" /><br/>When working on Maven web projects with Eclipse, m2e and m2e-wtp, Webapps can sometimes suddenly stop working, raising ClassNotFoundExceptions on every startup. This is because the webapp lib folder is no longer published to the server. Cleaning, Publishing, Closing/opening project, restarting Eclipse, nothing restore this folder and its content. Additionally, a new warning appears in [...]]]></description>
				<content:encoded><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2008/05/eclipse-642.png" width="64" height="37" alt="Eclipse" title="Eclipse" /><br/><p>When working on Maven web projects with Eclipse, m2e and m2e-wtp, Webapps can sometimes suddenly stop working, raising ClassNotFoundExceptions on every startup. </p>
<p>This is because the webapp lib folder is no longer published to the server. Cleaning, Publishing, Closing/opening project, restarting Eclipse, nothing restore this folder and its content. Additionally, a new warning appears in the problem view : </p>
<p><code>Classpath entry org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER will not be exported or published</code></p>
<p>To solve this issue, just open .classpath at the root of the project and add the following attribute to the maven classpath :</p>
<p><code>&lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt;</code></p>
<p>Save and publish to the server.</p>
<p>The webapp should start again.</p>
<p>Source: Post from Eclipse forums <a href="http://www.eclipse.org/forums/index.php/t/262101/" title="Original post">http://www.eclipse.org/forums/index.php/t/262101/</a></p>
<img src="http://feeds.feedburner.com/~r/LeBlogDeNicolasRicheton/~4/inLC-53Kfrc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.richeton.com/2012/08/31/solve-classnotfoundexceptions-with-maven-war-projects-on-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.richeton.com/2012/08/31/solve-classnotfoundexceptions-with-maven-war-projects-on-eclipse/</feedburner:origLink></item>
		<item>
		<title>Free mobile: les erreurs du site d’inscription</title>
		<link>http://feedproxy.google.com/~r/LeBlogDeNicolasRicheton/~3/SUsKRb04_NE/</link>
		<comments>http://blog.richeton.com/2012/01/25/free-mobile-les-erreurs-du-site-dinscription/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 08:56:58 +0000</pubDate>
		<dc:creator>Nicolas Richeton</dc:creator>
				<category><![CDATA[Computer]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.richeton.com/?p=1224</guid>
		<description><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2008/05/java_logo-641.png" width="64" height="40" alt="Java" title="Java" /><br/>Le site de Free Mobile a connu beaucoup de problèmes le jour de l&#8217;ouverture de l&#8217;offre: impossibilité de s&#8217;inscrire, inscriptions non prises en compte, etc. Ne tenant pas la charge, le site à été réécrit pendant la nuit, en effectuant au passage une transition de Java (Jsf) vers Php. En partant de ce constat, le [...]]]></description>
				<content:encoded><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2008/05/java_logo-641.png" width="64" height="40" alt="Java" title="Java" /><br/><p>Le site de <a href="http://mobile.free.fr/" title="Free Mobile">Free Mobile</a> a connu beaucoup de problèmes le jour de l&#8217;ouverture de l&#8217;offre: impossibilité de s&#8217;inscrire, inscriptions non prises en compte, etc. </p>
<p>Ne tenant pas la charge, le site à été réécrit pendant la nuit, en effectuant au passage une transition de Java (Jsf) vers Php.</p>
<p>En partant de ce constat, le <a href="http://fr.wikipedia.org/wiki/Troll_(Internet)" title="Troll Wikipedia">troll</a> Java Vs PHP est facile, mais plusieurs erreurs de conception ont largement contribué à l&#8217;écroulement du site:</p>
<p><strong>Avant l&#8217;ouverture:</strong><br />
Avant l&#8217;ouverture officielle des inscriptions, le site de Free Mobile affichait un message du type : &#8220;dans quelques instants vous pourrez consulter nos offres&#8221;</p>
<ul>
<li>Première erreur: Rechargement automatique toutes les minutes.
<p>la page se rafraîchissait automatiquement toutes les minutes.<br />
En plus des rafraîchissements manuels effectués par les impatients, ce code à généré un surplus de connexions et surtout a agit comme une retenue d&#8217;eau : <strong>à l&#8217;ouverture du vrai site, l&#8217;ensemble des utilisateurs en attente y ont accédé dans la première minute.</strong>&#8230;.</li>
</ul>
<p><strong>À l&#8217;ouverture</strong><br />
Le site utilisait un système de &#8220;slots&#8221; pour le processus d&#8217;inscription : seul un nombre limité d&#8217;utilisateurs pouvaient s&#8217;inscrire simultanément. Les autres devaient attendre.</p>
<ul>
<li>Deuxième erreur: Rechargement automatique toutes les 5 secondes.
<p>Lorsqu&#8217;aucun slot était disponible, le site affichait une page d&#8217;attente qui se rechargeait automatiquement toutes les 5 secondes pendant plusieurs minutes.<br />
<strong>En réponse à une surcharge, le site a multiplié volontairement la charge au bas mot entre 12x et 60x.</strong></li>
<li>Troisième erreur: Choix de JSF<br />
JSF est un framework par composants, orienté applications web (type intranet), qui a besoin de stocker en session, pour chaque utilisateur :
<ul>
<li>L&#8217;état de l&#8217;ensemble des composants de la page courante</li>
<li>Le même état pour les X dernières pages visitées pour permettre l&#8217;utilisation du bouton précédent</li>
</ul>
<p>&#8230; là où les frameworks orientés sites web publics ne stockent que l&#8217;identifiant de l&#8217;utilisateur, dans le cas où celui-ci est authentifié.</p>
<p>Dans le cas de free mobile, toutes les inscriptions sont faites par des utilisateurs différents. <strong>Le volume de données à stocker est donc énorme et n&#8217;est pas adapté à la fonction du site. </strong></p>
<p>Il est possible dans JSF de reporter ces données coté utilisateur en les intégrant dans le code html, au prix d&#8217;une augmentation de la bande passante. Cette configuration n&#8217;était pas utilisée sur free mobile.
 </li>
</ul>
<p><strong>Après la refonte:</strong><br />
Le site fonctionne maintenant en PHP, mais on peut voir que les leçons ont été tirées des problèmes ci-dessus: </p>
<ul>
<li>En cas de surcharge du site, la page d&#8217;erreur redirige immédiatement vers la page d&#8217;accueil. <strong>Il n&#8217;y a plus de rechargement automatique</strong>. La redirection est même suffisamment rapide pour empêcher les utilisateurs de recharger eux-même la page trop facilement. (Note: La page principale est statique.)</li>
<li>Le site est en php basique, sans utilisation de framework visible.<strong> On se doute qu&#8217;il n&#8217;y a quasiment pas de données en session, voir pas du tout</strong></li>
</ul>
<p><strong>Conclusion</strong></p>
<ul>
<li>Les rechargement de page en javascript sont dangereux sur les sites à forte charge. Il faut porter une extrême attention à leur impact sur le dimensionnement. Il vaut mieux privilégier un rechargement manuel de la page par l&#8217;utilisateur</li>
<li>La session est un élément sensible des applications web. Pour un site a forte audience, il faut limiter drastiquement les données stockées, ce qui exclut naturellement un certain nombre de frameworks de type JSF.
<p>En cas de nécessité, il est possible de déporter les données sur des caches mémoire, tels que memcache, ehcache, cohérence.</p>
</li>
<li>Un rappel: <strong>l&#8217;architecture mise en place ne dépend pas du langage</strong>. <strong>Faire une application complexe</strong> (modèle composant, de multiples couches, plein de données en session) ou ultra-simple quelques lignes dans un fichier <strong>est un choix</strong>, qui est réalisable de façon sensiblement identique dans les différents langages.</li>
</ul>
<p>J&#8217;en profite également pour placer le projet open source <a href="http://statelessfilter.sourceforge.net/" title="Stateless filtre">Stateless Filter</a> qui permet de déporter de façon transparente les sessions d&#8217;applications Java coté client ou dans un cache mémoire.</p>
<p>Les retours sont bien sûr les bienvenus. Je mettrai à jour l&#8217;article pour quelques corrections si nécessaire&#8230; </p>
<img src="http://feeds.feedburner.com/~r/LeBlogDeNicolasRicheton/~4/SUsKRb04_NE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.richeton.com/2012/01/25/free-mobile-les-erreurs-du-site-dinscription/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://blog.richeton.com/2012/01/25/free-mobile-les-erreurs-du-site-dinscription/</feedburner:origLink></item>
		<item>
		<title>Transparent javascript and css compression with Maven3 and Yuicompressor</title>
		<link>http://feedproxy.google.com/~r/LeBlogDeNicolasRicheton/~3/sQ05ZZsK4xA/</link>
		<comments>http://blog.richeton.com/2011/12/23/transparent-javascript-and-css-compression-with-maven3-and-yuicompressor/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 19:41:57 +0000</pubDate>
		<dc:creator>Nicolas Richeton</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://blog.richeton.com/?p=1200</guid>
		<description><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2008/05/java_logo-641.png" width="64" height="40" alt="Java" title="Java" /><br/>There are a lot of ressources on how to use YUIcompressor on a Maven project, but several examples don&#8217;t work with Maven3, or don&#8217;t allow to replace javascript and css by their compressed version transparently. The following example will compress files transparently when packaging the webapp in a WAR file, and keep original files for [...]]]></description>
				<content:encoded><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2008/05/java_logo-641.png" width="64" height="40" alt="Java" title="Java" /><br/><p>There are a lot of ressources on how to use <a href="http://alchim.sourceforge.net/yuicompressor-maven-plugin/compress-mojo.html" title="YUICompressor">YUIcompressor</a> on a Maven project, but several examples don&#8217;t work with Maven3, or don&#8217;t allow to replace javascript and css by their compressed version transparently. </p>
<p>The following example will compress files transparently when packaging the webapp in a WAR file, and keep original files for development.</p>
<p><code>&lt;plugin&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;version&gt;2.1.1&lt;/version&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&lt;configuration&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<strong>warSourceExcludes</strong>&gt;**/*.css,**/*.js&lt;<strong>/warSourceExcludes</strong>&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;/configuration&gt;<br />
&lt;/plugin&gt;<br />
<br/><br />
&lt;plugin&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;groupId&gt;net.alchim31.maven&lt;/groupId&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;artifactId&gt;yuicompressor-maven-plugin&lt;/artifactId&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;executions&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;execution&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;id&gt;compressyui&lt;/id&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<strong>phase</strong>&gt;prepare-package&lt;<strong>/phase</strong>&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;goals&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<strong>goal</strong>&gt;compress&lt;<strong>/goal</strong>&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/goals&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/execution&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&lt;/executions&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;configuration&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<strong>nosuffix</strong>&gt;true&lt;<strong>/nosuffix</strong>&gt;<br />
&nbsp;&nbsp;&nbsp;&lt;/configuration&gt;<br />
&lt;/plugin&gt;</code></p>
<img src="http://feeds.feedburner.com/~r/LeBlogDeNicolasRicheton/~4/sQ05ZZsK4xA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.richeton.com/2011/12/23/transparent-javascript-and-css-compression-with-maven3-and-yuicompressor/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.richeton.com/2011/12/23/transparent-javascript-and-css-compression-with-maven3-and-yuicompressor/</feedburner:origLink></item>
		<item>
		<title>XmlField : new validation API</title>
		<link>http://feedproxy.google.com/~r/LeBlogDeNicolasRicheton/~3/9bvNBM1gRX4/</link>
		<comments>http://blog.richeton.com/2011/12/21/xmlfield-new-validation-api/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 07:26:57 +0000</pubDate>
		<dc:creator>Nicolas Richeton</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.richeton.com/?p=1186</guid>
		<description><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2008/05/java_logo-641.png" width="64" height="40" alt="Java" title="Java" /><br/>XmlField 0.7 which was just released provides a new validation API, based on JSR 303, with some additions borrowed from Hibernate validation. It is now very simple to ensure objects are valid, without complex XPath expressions or XPath duplication. Add constraints to your interfaces : @ResourceXPath("/database") public interface IDatabase { &#160;&#160;&#160;@NotEmpty &#160;&#160;&#160;@FieldXPath("@name") &#160;&#160;&#160;String getName(); &#160;&#160;&#160;@Size(min=1) [...]]]></description>
				<content:encoded><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2008/05/java_logo-641.png" width="64" height="40" alt="Java" title="Java" /><br/><p><a href="http://xmlfield.sourceforge.net">XmlField</a> 0.7 which was just released provides a new validation API, based on JSR 303, with some additions borrowed from Hibernate validation.</p>
<p>It is now very simple to ensure objects are valid, without complex XPath expressions or XPath duplication.</p>
<p><strong>Add constraints to your interfaces :</strong><br />
<code>@ResourceXPath("/database")<br />
public interface IDatabase {<br />
&nbsp;&nbsp;&nbsp;<strong>@NotEmpty</strong><br />
&nbsp;&nbsp;&nbsp;@FieldXPath("@name")<br />
&nbsp;&nbsp;&nbsp;String getName();<br/><br />
&nbsp;&nbsp;&nbsp;<strong>@Size(min=1)</strong><br />
&nbsp;&nbsp;&nbsp;@FieldXPath("tables/table")<br />
&nbsp;&nbsp;&nbsp;ITable[] getTables();<br />
}<br />
</code></p>
<p><strong>Validate :</strong><br />
<code>IDatabase db = new XmlField().xmlToObject( xmlString, IDatabase.class );<br/><br />
<strong>Set&lt;ConstraintViolation&lt;Object&gt;&gt; violations = new XmlFieldValidator().validate( db );</strong><br />
</code></p>
<p><strong>Supported annotations : </strong></p>
<ul>
<li><strong>@NotEmpty</strong> : value exists and is not blank</li>
<li><strong>@Size</strong> : string length, array size   </li>
<li><strong>@Range</strong> : numbers between min and max</li>
<li><strong>@Values</strong> : check for accepted values</li>
</ul>
<p>Enjoy <img src='http://blog.richeton.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>See also : <a href="http://blog.richeton.com/2011/11/28/introducing-xmlfield-java-xml-object-mapping-framework/" title="Introducing XmlField : Java xml/object mapping framework">Introducing XmlField : Java xml/object mapping framework</a></p>
<img src="http://feeds.feedburner.com/~r/LeBlogDeNicolasRicheton/~4/9bvNBM1gRX4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.richeton.com/2011/12/21/xmlfield-new-validation-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.richeton.com/2011/12/21/xmlfield-new-validation-api/</feedburner:origLink></item>
		<item>
		<title>Introducing XmlField : Java xml/object mapping framework</title>
		<link>http://feedproxy.google.com/~r/LeBlogDeNicolasRicheton/~3/dpcCRw8ZX8Q/</link>
		<comments>http://blog.richeton.com/2011/11/28/introducing-xmlfield-java-xml-object-mapping-framework/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 07:38:53 +0000</pubDate>
		<dc:creator>Nicolas Richeton</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.richeton.com/?p=1152</guid>
		<description><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2008/05/java_logo-641.png" width="64" height="40" alt="Java" title="Java" /><br/>We have recently released XmlField, a new Java xml/object mapping framework. There are already a lot of tools for this, but none seemed to fit our requirements : A (very) simple API : we wanted to write as few code/configuration as possible, and keep code meaningful. The ability to process and update XML documents without [...]]]></description>
				<content:encoded><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2008/05/java_logo-641.png" width="64" height="40" alt="Java" title="Java" /><br/><p>We have recently released <a href="http://xmlfield.sourceforge.net">XmlField</a>, a new Java xml/object mapping framework. </p>
<p><center><a href="http://xmlfield.sourceforge.net"><img src="http://xmlfield.sourceforge.net/images/logo.png" alt="XmlField logo" /></a></center></p>
<p>There are already a lot of tools for this, but none seemed to fit our requirements :</p>
<ul>
<li>A (very) simple API : we wanted to write as few code/configuration as possible, and keep code meaningful.</li>
<li>The ability to process and update XML documents without altering additional, unsupported data. This means that the XML model can be updated without requiring to update and deploy existing applications in most cases.  (for more information see the <a href="http://xmlfield.sourceforge.net/behavior.html">&#8220;Behavior&#8221; page</a> on the projet&#8217;s site.</li>
<li>No need to have a 1:1 mapping between the object XML structure, ability to flatten an XML document into a single object</li>
</ul>
<p>If you&#8217;re writing a standalone application and use XML for storing configuration, XmlField will not be a major improvement (you may still like its simple API).</p>
<p>But if you are working in a corporate environment, with multiple applications sharing data using web or REST services, you may already see the benefits of these points.</p>
<p>A typical use case could be a system where user related data is stored in a central repository as xml documents and where this data is exposed through web services and used by several applications (both for reading and writing).</p>
<p>A some point, a new application requires additional data, which is not currently part of the xml model. This usually requires to update the central repository, adding support for this data through a new version of the web services, then maintain 2 versions of these services or move all existing applications to the new model to get rid of the previous one.</p>
<p>With XmlField-based applications, you just have to create your new app which stores additionnal tags in xml doduments. No need to update the central repository nor other applications. They will continue to process and update Xml objects, ignoring the new data but keeping it safe. </p>
<p>On the technical side, XmlField uses annotated interfaces to map xml data to objects. An interface can be written this way : </p>
<p><code><strong>@ResourceXPath("/modelRootTag")</strong><br />
public interface IModel {<br />
   <strong>@FieldXPath("version")</strong><br />
   String getVersion();<br/><br />
   <strong>@FieldXPath("flag")</strong><br />
   boolean getFlag();<br/><br />
   <strong>@FieldXPath("entries/entry")</strong><br />
   IEntry getEntries();<br/><br />
   void setVersion(String version);<br/><br />
   void setFlag(boolean flag);<br/><br />
   IEntry addToEntries();<br />
}</code></p>
<p>Then XmlField can be used this way :<br />
<code>// Source Xml<br />
String xml ="<modelRootTag></modelRootTag>";<br/><br />
// Read doc<br />
<strong>XmlField</strong> xf = new <strong>XmlField</strong>();<br />
IModel model = <strong>xf.xmlToObject</strong>(xmlRessource, IModel.class);<br/><br />
// Play with XML<br />
model.setVersion( "1.0" );<br />
String firstEntryName = model.getEntries()[0].getName();<br/><br />
//Add entry<br />
IEntry newEntry = model.addToEntries();<br />
newEntry.setName( "entry4" );<br />
newEntry.setValue( "value4" );<br/><br />
// Back to XML.<br />
xml = <strong>xf.objectToXml</strong>( model);<br />
</code></p>
<p>For more detailed examples, I just added a <a href="http://xmlfield.sourceforge.net/">quickstart tutorial</a> and a <a href="http://xmlfield.sourceforge.net/model.html">step-by-step example</a> to the project&#8217;s website. </p>
<p>Even if the version number is only 0.6 yet, XmlField is stable enough for most uses and is currently used in production by several projects in different companies. We plan to reach 1.0 after the addition of a new document repository module, providing a lightweight xml document store with search and data validation.</p>
<p>Feedback is welcome. Feel free to test, use and report bugs or patchs using the project bugtracker and mailing lists. </p>
<p>XmlField released under the Apache Licence V2.0</p>
<p><a href="http://xmlfield.sourceforge.net">http://xmlfield.sourceforge.net</a></p>
<p>(Related keywords : xml, java, serialization, marshalling, mapping, binding)</p>
<img src="http://feeds.feedburner.com/~r/LeBlogDeNicolasRicheton/~4/dpcCRw8ZX8Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.richeton.com/2011/11/28/introducing-xmlfield-java-xml-object-mapping-framework/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.richeton.com/2011/11/28/introducing-xmlfield-java-xml-object-mapping-framework/</feedburner:origLink></item>
		<item>
		<title>Solve webapp random startup errors (connection time out) and slowness</title>
		<link>http://feedproxy.google.com/~r/LeBlogDeNicolasRicheton/~3/ordqEIX5S6A/</link>
		<comments>http://blog.richeton.com/2011/02/16/solve-webapp-random-startup-errors-connection-time-out-and-slowness/#comments</comments>
		<pubDate>Tue, 15 Feb 2011 22:23:49 +0000</pubDate>
		<dc:creator>Nicolas Richeton</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://blog.richeton.com/?p=1124</guid>
		<description><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2008/05/java_logo-641.png" width="64" height="40" alt="Java" title="Java" /><br/>When developping Java web apps, you may sometime see random startup errors like this one : java.lang.IllegalStateException: Unable to instantiate container. at org.apache.tiles.web.startup.TilesListener.contextInitialized(TilesListener.java:60) at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:549) at org.mortbay.jetty.servlet.Context.startContext(Context.java:136) at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282) at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518) at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499) (...) Most of the time your application works, but sometimes it just does not start. This is because of the dtd resolution [...]]]></description>
				<content:encoded><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2008/05/java_logo-641.png" width="64" height="40" alt="Java" title="Java" /><br/><p>When developping Java web apps, you may sometime see random startup errors like this one :<br />
<code><br />
java.lang.IllegalStateException: Unable to instantiate container.<br />
	at org.apache.tiles.web.startup.TilesListener.contextInitialized(TilesListener.java:60)<br />
	at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:549)<br />
	at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)<br />
	at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1282)<br />
	at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:518)<br />
	at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:499)<br />
	(...)<br />
</code></p>
<p>Most of the time your application works, but sometimes it just does not start. </p>
<p>This is because of the dtd resolution mecanism: if you use the reference of  a dtd which is not in the webapp classpath, the container will try to get it from internet. </p>
<p>If the remote site is down (in this case <a href="http://tiles.apache.org/">http://tiles.apache.org</a>), your app will no longer start. </p>
<p>Sadly, it&#8217;s easy to get in this situation. </p>
<ul>
<li>Upgrade a library without updating xml headers</li>
<li>Copy/Paste a snippet from the elsewhere</li>
</ul>
<p>&#8230; and the container will start to fetch dtds from the internet.</p>
<p>In my case, the previous error was caused by :</p>
<p><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?></p>
<p><em>&lt;!DOCTYPE tiles-definitions PUBLIC<br />
       "-//Apache Software Foundation//DTD Tiles Configuration 2.<strong>1</strong >//EN"<br />
       "http://tiles.apache.org/dtds/tiles-config_2_<strong>1</strong >.dtd"></em></p>
<p>&lt;tiles-definitions><br />
(...)<br />
&lt;/tiles-definitions></code></p>
<p>instead of :</p>
<p><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?></p>
<p><em>&lt;!DOCTYPE tiles-definitions PUBLIC<br />
       "-//Apache Software Foundation//DTD Tiles Configuration 2.<strong>0</strong >//EN"<br />
       "http://tiles.apache.org/dtds/tiles-config_2_<strong>0</strong >.dtd"></em></p>
<p>&lt;tiles-definitions><br />
(...)<br />
&lt;/tiles-definitions></code></p>
<p>With tiles 2.0.6 in the classpath. </p>
<p><strong>Conclusion</strong><br />
Be sure to use the exact version of the dtd in your classpath. Don&#8217;t pickup examples from the internet without double-checking the dtd.<br />
This will prevent longer startup times and potential random errors.</p>
<p>Note: this post dedicated to Olivier and Jimmy <img src='http://blog.richeton.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/LeBlogDeNicolasRicheton/~4/ordqEIX5S6A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.richeton.com/2011/02/16/solve-webapp-random-startup-errors-connection-time-out-and-slowness/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.richeton.com/2011/02/16/solve-webapp-random-startup-errors-connection-time-out-and-slowness/</feedburner:origLink></item>
		<item>
		<title>ESIGate Tutorial – Partie 2</title>
		<link>http://feedproxy.google.com/~r/LeBlogDeNicolasRicheton/~3/_Us6gLQLpw0/</link>
		<comments>http://blog.richeton.com/2010/12/16/esigate-tutorial-%e2%80%93-partie-2/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 22:20:47 +0000</pubDate>
		<dc:creator>Nicolas Richeton</dc:creator>
				<category><![CDATA[ESIGate]]></category>

		<guid isPermaLink="false">http://blog.richeton.com/?p=1106</guid>
		<description><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2010/10/esigate.png" width="54" height="64" alt="ESIGate" title="ESIGate" /><br/>Après une première partie technique, nous allons étudier une partie plus théorique sur les différents usages d&#8217;ESIGate dans des projets Web. Attention: Article en cours de rédaction, les concepts étant relativement complexes à comprendre (mais simples à mettre en oeuvre), vous êtes invités à commenter ce post pour aider à l&#8217;améliorer. Le coeur d&#8217;ESIGate est [...]]]></description>
				<content:encoded><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2010/10/esigate.png" width="54" height="64" alt="ESIGate" title="ESIGate" /><br/><p>Après une <a href="/2010/10/24/esigate-tutorial-partie-1">première partie</a> technique, nous allons étudier une partie plus théorique sur les différents usages d&#8217;ESIGate dans des projets Web.</p>
<p><strong>Attention</strong>: Article en cours de rédaction, les concepts étant relativement complexes à comprendre (mais simples à mettre en oeuvre), vous êtes invités à commenter ce post pour aider à l&#8217;améliorer.</p>
<p>Le coeur d&#8217;ESIGate est une implémentation Java d&#8217;un moteur d&#8217;ESI : </p>
<ul>
<li>a partir d&#8217;un document HTML, le framework va parser le flux à la recherche de directives référençant des contenus à intégrer depuis des URL externes. </li>
<li>Ces contenus sont récupérés et mis en cache automatiquement, puis insérés dans le flux HTML original.</li>
<li>Les directives peuvent soit suivre la norme <a href="http://www.w3.org/TR/esi-lang">ESI</a>, soit utiliser le format ESIGate, plus riche en terme de fonctionnalités.</li>
</ul>
<p><strong>ESI, à quoi ça sert ?</strong><br />
Les usages sont multiples, mais à l&#8217;origine la norme ESI permet d&#8217;étendre les possibilités de mise en cache des pages produites par des applications web et donc d&#8217;améliorer grandement leurs performances. </p>
<p><span id="more-1106"></span></p>
<p>En effet, dans une application web, les pages sont généralement dynamiques et ce, même quand la majorité des contenus restent identiques pour l&#8217;ensemble des utilisateurs (le syndrome du &#8216;Bonjour M. Toto, il est 12h45&#8242; qui, pour quelques caractères, interdit la mise en cache de la page). </p>
<p>L&#8217;ESI donne la possibilité de mettre en cache le contenu par fragments. En donnant les directives nécessaires à un cache situé en amont (Akamai, Varnish) pour découper la page en fragments HTML, chacun avec une durée de vie différente et pour récupérer les fragments expirés depuis des urls dédiées.</p>
<p>Ainsi, l&#8217;application n&#8217;est plus appelée que pour gérer le contenu dépendant de l&#8217;utilisateur, réduisant directement la charge du serveur. </p>
<p>Exemple de page utilisant des directives ESI pour Akamai:<br />
<code><br />
&lt;h2&gt;Example 2&lt;/h2&gt;<br />
The following esi code is used for the customer testimonials on the www.akamai.com<br />
home page. The included file is a ColdFusion script that selects one of four<br />
graphics at random and displays them. &lt;pre&gt;&lt;esi:include src="http://www.akamai.com/cfcgi/quote_swap.dbm" ttl="5m"/&gt;&lt;br&gt;&lt;esi:remove&gt;&lt;br&gt;  &lt;img src="/graphics/layout/quote1.jpg" width="144" height="193" border="0"&gt;&lt;br&gt;&lt;/esi:remove&gt;&lt;br&gt;&lt;br&gt;&lt;/pre&gt;</p>
<p>&lt;br&gt;ESI Output:&lt;br&gt;</p>
<p>&lt;esi:include src="http://www.akamai.com/cfcgi/quote_swap.dbm" ttl="5m"/&gt;<br />
&lt;esi:remove&gt;<br />
  &lt;img src="/graphics/layout/quote1.jpg" width="144" height="193" border="0"&gt;<br />
&lt;/esi:remove&gt;<br />
</code></p>
<p>Ici la directive include va récupérer un contenu externe, lourd à générer et le met en cache 5 minutes.<br />
La directive remove permet de spécifier un contenu &#8216;bouchon&#8217; qui permet de visualiser la page sans passer par un proxy ESI (très utile pour le travail de montage HTML par exemple).</p>
<p><strong>Aller plus loin</strong><br />
ESIGate va pousser le concept ESI au delà des problématiques de performance, en permettant l&#8217;intégration d&#8217;applications au sein d&#8217;une IHM unique, cohérente, évolutive et surtout simple à mettre en place. </p>
<p>En effet, l&#8217;intégration dans un même site web de composants tels que CMS, Outil de e-commerce et développements spécifiques se fait  toujours plus ou moins dans la douleur : </p>
<p>Au départ, il y a les fonctionnalités natives de chaque outil qui permettent de choisir celui qui est le plus adapté au besoin. On trouvera toujours un outil qui, utilisé de façon autonome, correspond parfaitement au périmètre fonctionnel demandé. </p>
<p>La situation se complique lorsque l&#8217;on souhaite additionner plusieurs outils : frameworks et technologies incompatibles (ex: Java et PHP),  fonctions ou IHM à réécrire complètement à cause d&#8217;une intégration via API (ex: prévisualisation de contenus, urls propres, inplace-editing, &#8230;), duplication des efforts de montage, gestion de l&#8217;utilisateur, &#8230;.   <strong>Le coût du projet s&#8217;envole</strong>.</p>
<p>ESIGate permet de mettre en place les applications de façon indépendante et de réaliser une intégration via leurs flux HTML :</p>
<ul>
<li>Le CMS est généralement désigné porteur du thème graphique, les autres applications se synchronisant avec lui.</li>
<li> Chaque application reste maître de son périmètre (Editorial, Vente, Production, Administration) et intégrera les contenus ou informations provenant des autres applications via fragments HTML. </li>
</ul>
<p>Pour arriver à ce résultat, il faut tirer partie des fonctions supplémentaires d&#8217;ESIGate: </p>
<ul>
<li>
Le templating distant (sorte d&#8217;ESI inversé, où on ne référence pas des fragments externe, mais un thème distant pour lequel on fournit les blocs à intégrer)</li>
<li>Les substitutions, les paramètres et les blocs nommés dans les fragments à intégrer</li>
<li>La gestion des sessions distantes (réconciliation des multiples sessions distantes en une seule session visible)</li>
<li>Propagation des informations d&#8217;authentification avec les systèmes SSO supportant les Proxy ticket granting : implémentatation fournie pour <a href="http://www.jasig.org/cas">Jasig CAS</a>.</li>
</ul>
<p><strong>Mise en oeuvre</strong></p>
<p>Tout d&#8217;abord, il faut présenter les différentes configuration et outils d&#8217;ESIGate :</p>
<ul>
<li><strong>L&#8217;API</strong> : le coeur du framework, à n&#8217;utiliser que si vous souhaitez un comportement totalement personnalisé. Elle sert de base à l&#8217;ensemble des éléments suivants</li>
<li><strong>Le Reverse proxy ESI</strong> : implémentation classique de l&#8217;ESI, ESIGate fonctionne en serveur standalone et agrège les flux HTML à partir des directives présentes dans le flux HTML</li>
<li><strong>La taglib</strong> : les fonctions d&#8217;intégration sont directement intégrées à une applications Java supportant les JSP</li>
<li><strong>Les composants JSF</strong> : les fonctions d&#8217;intégration sont directement intégrées à une application Java/JSF</li>
<li><strong>Les composants Wicket</strong> : les fonctions d&#8217;intégration sont directement intégrées à une application Java/wicket</li>
<li><strong>Le reverse Proxy de développement</strong>: plus dédié au développement d&#8217;applications Java nécessitant un reverse proxy, il peut simuler une configuration reverse proxy d&#8217;Apache directement dans un serveur Java. L&#8217;objectif étant de ne pas installer Apache sur le poste des développeurs : checkout->run</li>
<li><strong>ESIGate Static Assembly</strong>: Dédié aux monteurs HTML, permet de bénéficier d&#8217;un système de templating HTML brut (pas d&#8217;application web ou de serveur à installer), permettant l&#8217;utilisation de squelettes et de contenus communs pour l&#8217;édition HTML/CSS</li>
</ul>
<p>Pour l&#8217;intégration d&#8217;applications, on utilisera le reverse proxy ESI ou les composants/taglib Java. Les configurations classiques sont : </p>
<ul>
<li>Pour intégrer une application Java dans un site existant, la solution composant/taglib est la plus simple, car elle n&#8217;ajoute pas de serveur/service supplémentaire. ESIGate s&#8217;intègre de façon quasi transparente en traitant les inclusions ou le templating à la volée. Seul un serveur Apache est nécessaire pour répartir les requêtes entre les différentes applications (configuation reverse proxy classique)</li>
<li>Pour intégrer une application utilisant une technologie différente de Java ou tout simplement pour ne poser aucune contrainte, on utilisera le reverse proxy ESI, après le frontal HTTP traditionnel, pour retraiter tous les flux des applications. ESIGate aura le rôle de transmission du flux entrant vers l&#8217;application cible et celui d&#8217;assemblage du flux sortant en allant interroger les autres applications du site.</li>
</ul>
<p>- La suite pour bientôt, avec des schémas <img src='http://blog.richeton.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  -</p>
<img src="http://feeds.feedburner.com/~r/LeBlogDeNicolasRicheton/~4/_Us6gLQLpw0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.richeton.com/2010/12/16/esigate-tutorial-%e2%80%93-partie-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.richeton.com/2010/12/16/esigate-tutorial-%e2%80%93-partie-2/</feedburner:origLink></item>
		<item>
		<title>ESIGate Tutorial – Part 1</title>
		<link>http://feedproxy.google.com/~r/LeBlogDeNicolasRicheton/~3/yonDR1IaA78/</link>
		<comments>http://blog.richeton.com/2010/11/28/esigate-tutorial-part-1/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 13:02:19 +0000</pubDate>
		<dc:creator>Nicolas Richeton</dc:creator>
				<category><![CDATA[ESIGate]]></category>

		<guid isPermaLink="false">http://blog.richeton.com/?p=1065</guid>
		<description><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2010/10/esigate.png" width="54" height="64" alt="ESIGate" title="ESIGate" /><br/>(Ce tutorial est aussi disponible en Français : ESIGate Tutorial &#8211; Partie 1) In this series, I will present the various uses of ESIGate framework (former Assembly Web Tool &#8211; WAT). In Part 1, we will integrate a very simple application in a remote template, only via http. The typical use is a corporate intranet: [...]]]></description>
				<content:encoded><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2010/10/esigate.png" width="54" height="64" alt="ESIGate" title="ESIGate" /><br/><p>(Ce tutorial est aussi disponible en Français : <a href="/2010/10/24/esigate-tutorial-partie-1/">ESIGate Tutorial &#8211; Partie 1</a>)</p>
<p>In this series, I will present the various uses of <a href="http://www.esigate.org">ESIGate</a> framework (former Assembly Web Tool &#8211; WAT).</p>
<p>In Part 1, we will integrate a very simple application in a remote template, only via http. The typical use is a corporate intranet: multiple different applications (content management, HR management, time reporting, etc &#8230;) can use the same theme, based on a master application.</p>
<p>This has the following benefits:</p>
<ul>
<li> almost no need to work on styling (html/css) in slave applications. </li>
<li> When the theme changes in the master application, the changes are immediately reflected on all slave applications without restart </ li>
<li> the master application can be replaced with no impact if the new theme is compatible </li>
<li> If the new master application is incompatible with the previous theme, the synchronization can be &#8216;broken&#8217; by pointing slave applications on a static html file</li>
</ul>
<p><img src="http://blog.richeton.com/wp-content/uploads/2010/11/usecase3-300x227.png" alt="" title="usecase" width="300" height="227" class="aligncenter size-medium wp-image-1091" /></p>
<p><span id="more-1065"></span></p>
<p>We&#8217;ll start from the archetype <strong>maven-archetype -webapp</strong>. In eclipse, create a new Maven project, and select the archetype maven-archetype-webapp. You can also directly use the command line.</p>
<p><a href="http://blog.richeton.com/wp-content/uploads/2010/10/newproject-archetype.png"><img src = "http://blog.richeton.com/wp-content/uploads/2010/10/newproject-archetype.png" alt =" " title =" newproject-archetype" width ="824" height ="541" class ="aligncenter size-full wp-image-1009"/> </a></p>
<p><a href="http://blog.richeton.com/wp-content/uploads/2010/10/newproject-configuration.png"> <img src = "http://blog.richeton.com/wp-content/uploads/2010/10/newproject-configuration.png" alt =" " title="newproject-configuration" width="823" height="255" class ="aligncenter size-full wp-image-1007"/> </a></p>
<p>Let&#8217;s start :</p>
<p><strong> Configuring Jetty: </strong></p>
<p>To let users to easily test the application, add Jetty in the pom.xml: in the build section, add jetty-maven-plugin.</p>
<p><code>(...)<br/>	&lt;build&gt;<br/>		&lt;finalName&gt;esigate-tutorial&lt;/finalName&gt;<br/>		&lt;plugins&gt;<br/>			&lt;plugin&gt;<br/>				&lt;groupId&gt;org.mortbay.jetty&lt;/groupId&gt;<br/>				&lt;artifactId&gt;jetty-maven-plugin&lt;/artifactId&gt;<br/>				&lt;version&gt;7.2.0.RC0&lt;/version&gt;<br/>			&lt;/plugin&gt;<br/>		&lt;/plugins&gt;<br/>	&lt;/build&gt;<br/>(...)</code></p>
<p>Jetty can now be started using:<br />
<code> mvn jetty: run </code></p>
<p>By pointing your browser to http://localhost:8080/ you should get:</p>
<p><img src = "http://blog.richeton.com/wp-content/uploads/2010/10/hello-world.png" alt = "" alt = "hello-world" width = "174" height = " 44 "class =" aligncenter size-full wp-image-1015 "/></p>
<p>Quick improvement of <b>archetype</b><br />
We modify the index.jsp file to have a bit more text:</p>
<p><img src = "http://blog.richeton.com/wp-content/uploads/2010/10/code1.png" alt = "" title = "code1" width = "399" height = "146" class = "size-full wp-image-1028" /><br />
<img src = "http://blog.richeton.com/wp-content/uploads/2010/10/hello-world-plus.png" alt = "" alt = "hello-world-plus" width = "320" height ="81" class ="aligncenter size-full wp-image-1018"/></p>
<p><b>Step 1: Add ESIGate</b><br />
In the pom.xml, add dependency on ESIGate :<br />
<code>&lt;dependency&gt;<br/>			&lt;groupId&gt;net.sourceforge.webassembletool&lt;/groupId&gt;<br/>			&lt;artifactId&gt;webassembletool-taglib&lt;/artifactId&gt;<br/>			&lt;version&gt;2.17&lt;/version&gt;<br/>		&lt;/dependency&gt;</code></p>
<p>and ESIGate&#8217;s Maven repository:<br />
<code>&lt;repositories&gt;<br/>		&lt;repository&gt;<br/>			&lt;id&gt;webassembletool-repository&lt;/id&gt;<br/>			&lt;name&gt;Website Assembling Toolkit repository&lt;/name&gt;<br/>			&lt;url&gt;http://webassembletool.sourceforge.net/maven/repository&lt;/url&gt;<br/>		&lt;/repository&gt;<br/>	&lt;/repositories&gt;</code></p>
<p>Now we&#8217;ll use the template demonstration ESIGate (<a href="http://webassembletool.svn.sourceforge.net/viewvc/webassembletool/tags/webassembletool-2.17/src/site/resources/examples/templates/sparkle/index.html?revision=546&#038;view=markup">source</a>, <a href="http://www.esigate.org/examples/templates/sparkle/index.html">link </a>).<br />
<a href="http://blog.richeton.com/wp-content/uploads/2010/10/template.png"><img src="http://blog.richeton.com/wp-content/uploads/2010/10/template-300x278.png" alt="" title="template" width="300" height="278" class="alignnone size-medium wp-image-1025" /></a></p>
<p><strong> Step 2: Integrate the template ESIGate example: </strong><br />
Add driver.properties in the package : net.webassembletool:<br />
<code><br />
remoteUrlBase = http://www.esigate.org/examples/<br />
</code><br />
This configuration specifies that all files requested by ESIGate will be located in the examples folder of the site esigate.org.</p>
<p>Then, edit the index.jsp as follows:<br />
<img src = "http://blog.richeton.com/wp-content/uploads/2010/10/code2.png" alt = "" title = "code2" width = "526" height = "282" class = "alignleft size-full wp-image-1030" /></p>
<p>In this code, we just :</p>
<ul>
<li> Added the taglib </li>
<li> Specified  the template to use: http://www.esigate.org/examples/templates/sparkle/index.html </li>
<li> Defined 2 blocks: title and colTwo </li>
</ul>
<p>Things to know :</p>
<ul>
<li> Any code that is not included in a block is ignored. Thus html, head and body tags will disappear and be replaced by the template&#8217;s own tags </li>
<li> The demo template defines 8 blocks: title, head, header, menu, colOne, colTwo, colThree and footer </li>
</ul>
<p>Refresh the page and voila!<br />
Your application is integrated into the example template.</p>
<p><a href="http://blog.richeton.com/wp-content/uploads/2010/10/integration1.png"><img src = "http://blog.richeton.com/wp-content/uploads/2010/10/integration1-276x300.png" alt =" " title =" integration1" width ="276" height ="300 " class ="alignnone size-medium wp-image-1036"/> </a></p>
<p><strong> Step 3: Replacing the menu </strong><br />
We will replace the default menu by ours.<br />
<img src = "http://blog.richeton.com/wp-content/uploads/2010/10/code3.png" alt = "" title = "code3" width = "533" height = "431" class = "alignnone size-full wp-image-1043" /></p>
<p>The result:<br />
<a href="http://blog.richeton.com/wp-content/uploads/2010/10/integration2.png"><img src = "http://blog.richeton.com/wp-content/uploads/2010/10/integration2-274x300.png" alt =" " title =" integration2" width ="274"  height ="300" class ="alignnone size-medium wp-image-1046 "/></a></p>
<p><strong> Step 4: Fetch a content block. </strong><br />
 ESIGate can also fetch a remote block content and insert it within the page. For this example, we will integrate block &#8216;block1&#8242; from the <a href="http://webassembletool.svn.sourceforge.net/viewvc/webassembletool/tags/webassembletool-2.17/src/site/resources/examples/content/blocks.html?revision=546&#038;view=markup">content examples </a>.<br />
<img src = "http://blog.richeton.com/wp-content/uploads/2010/10/code4.png" alt = "" title = "Code4" width = "527" height = "540" class = "alignnone size-full wp-image-1049" /></p>
<p>Result:<br />
<a href="http://blog.richeton.com/wp-content/uploads/2010/10/integration3.png"><img src="http://blog.richeton.com/wp-content/uploads/2010/10/integration3-300x277.png" alt="" title="integration3" width="300" height="277" class="alignnone size-medium wp-image-1051" /></a></p>
<p><strong>Conclusion</strong><br />
With only a few lines of code, we synchronized the theme of our application with the demo template of  ESIGate. Any changes will be applied without restarting the application (possibly after several minutes, because of the cache).</p>
<p>Stay tuned for more tutorials.</p>
<img src="http://feeds.feedburner.com/~r/LeBlogDeNicolasRicheton/~4/yonDR1IaA78" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.richeton.com/2010/11/28/esigate-tutorial-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.richeton.com/2010/11/28/esigate-tutorial-part-1/</feedburner:origLink></item>
		<item>
		<title>Git : set committer name and email</title>
		<link>http://feedproxy.google.com/~r/LeBlogDeNicolasRicheton/~3/dNTDDQZyHFA/</link>
		<comments>http://blog.richeton.com/2010/11/28/git-set-committer-name-and-email/#comments</comments>
		<pubDate>Sun, 28 Nov 2010 10:24:03 +0000</pubDate>
		<dc:creator>Nicolas Richeton</dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://blog.richeton.com/?p=1059</guid>
		<description><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2010/11/git-logo-e1290949971277.png" width="24" height="48" alt="git" title="git" /><br/>git config --global user.name "&#60;your-name&#62;" git config --global user.email "&#60;your-email&#62;"]]></description>
				<content:encoded><![CDATA[<img src="http://blog.richeton.com/wp-content/uploads/2010/11/git-logo-e1290949971277.png" width="24" height="48" alt="git" title="git" /><br/><p><code>git config --global user.name "&lt;your-name&gt;"<br />
git config --global user.email "&lt;your-email&gt;"</code></p>
<img src="http://feeds.feedburner.com/~r/LeBlogDeNicolasRicheton/~4/dNTDDQZyHFA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.richeton.com/2010/11/28/git-set-committer-name-and-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.richeton.com/2010/11/28/git-set-committer-name-and-email/</feedburner:origLink></item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Database Caching 24/47 queries in 0.015 seconds using apc
Object Caching 1404/1472 objects using apc

 Served from: blog.richeton.com @ 2013-05-23 05:44:24 by W3 Total Cache -->
