<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://blog.netapsys.fr/index.php/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
  <title>Netapsys Blog - netapsys</title>
  <link>http://blog.netapsys.fr/index.php/</link>
  <description></description>
  <language>fr</language>
  <pubDate>Thu, 29 Jul 2010 16:33:35 +0200</pubDate>
  <copyright>Netapsys 2008 - 2009</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>Premier retour après un premier mois chez Netapsys</title>
    <link>http://blog.netapsys.fr/index.php/post/2009/10/18/Premier-retour-apres-un-premier-mois-chez-Netapsys</link>
    <guid isPermaLink="false">urn:md5:5ab2f2e2de91c2d57df28555c2e2b8ac</guid>
    <pubDate>Sun, 18 Oct 2009 13:57:00 +0200</pubDate>
    <dc:creator>Fabian Piau</dc:creator>
        <category>Générale</category>
        <category>design patterns</category><category>extreme programming</category><category>netapsys</category>    
    <description>&lt;p&gt;Arrivé depuis maintenant un mois chez Netapsys, je peux déjà dire que j'ai appris beaucoup de choses sur le plan technique et sur le développement. Un peu moins au niveau méthodologique, car il faut dire que j’ai déjà eu quelques expériences en méthodologie agile, notamment en &lt;a href=&quot;http://fr.wikipedia.org/wiki/Extreme_programming&quot; hreflang=&quot;fr&quot;&gt;eXtreme Programming&lt;/a&gt; : intégration continue (IC) et TDD (test-driven development ou développement dirigé par les tests). Mais, quel plaisir de pouvoir continuer à les utiliser….&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://carmaworld.free.fr/blog/wp-content/posts/00005/xp.png&quot; alt=&quot;Logo XP&quot; style=&quot;display:block; margin:0 auto;&quot; /&gt;&lt;/p&gt;    &lt;p&gt;Issu d'un parcours MIAGE et ayant des expériences qui découlent plus de la gestion de projet que de la technique pure, j'ai dû m'accrocher. En effet, les collaborateurs ont un bagage technique qui est plutôt &quot;impressionnant&quot;. Actuellement, je travaille sur un projet JAVA/J2EE dont le fonctionnel concerne la gestion administrative et financière de projet (en rapport avec ma formation donc).&lt;/p&gt;


&lt;p&gt;Je pense qu’entrer chez Netapsys est réellement une très bonne opportunité pour monter en compétences  techniques rapidement, de plus sur des bases technologiques et des méthodes plutôt pérennes. Un chef de projet qui maîtrise son sujet sera toujours un meilleur chef de projet, car il pourra quantifier une charge réaliste en fonction de la difficulté technique à réaliser et ainsi, diriger son équipe plus efficacement.&lt;/p&gt;


&lt;p&gt;Par exemple, j'avais entendu parler de la notion de &lt;a href=&quot;http://fr.wikipedia.org/wiki/Patron_de_conception&quot; hreflang=&quot;fr&quot;&gt;design-pattern&lt;/a&gt; (Factory et Singleton principalement), mais je ne les avais jamais réellement mis en œuvre ou vu leur véritable intérêt (un peu avec Spring cependant). Exception faite pour le modèle &lt;a href=&quot;http://fr.wikipedia.org/wiki/Mod%C3%A8le-Vue-Contr%C3%B4leur&quot; hreflang=&quot;fr&quot;&gt;MVC&lt;/a&gt; (Modèle-Vue-Contrôleur) qui est pourtant un pattern et qui, aujourd’hui est plus vu comme un standard.&lt;/p&gt;


&lt;p&gt;Finalement, les patterns sont donc très utiles, il y en aura toujours un qui sera adapté pour telle ou telle situation. J’ai même été un peu surpris qu’il y en ait autant (un bouquin de plusieurs centaines de pages est toujours disponible à l’entreprise pour s’y référer). Les semaines passées, j'ai appris à utiliser et implémenter le pattern de stratégie, détaillé dans un &lt;a href=&quot;http://blog.netapsys.fr/index.php/post/2009/09/08/Pratiquer-le-design-pattern-Strategy-en-15-min&quot; hreflang=&quot;fr&quot;&gt;post précédent&lt;/a&gt;.&lt;/p&gt;


&lt;p&gt;Tous ces patterns permettent une meilleure généricité de l'application, et donc une meilleure maintenance. L'application à maintenir devient une sorte de mur solide (de préférence ;-), dont les évolutions (ou correction de bogues) ne s'apparentent qu'à l’ajout (ou le remplacement) de quelques briques.
Netapsys s'inscrit dans ce contexte d'amélioration continue. Et, comme l'a dit Denis sur son &lt;a href=&quot;http://blog.netapsys.fr/index.php/post/2009/10/16/Lagile-tour-a-fait-une-etape-a-Nantes-le-mercredi-14-octobre-2009&quot; hreflang=&quot;fr&quot;&gt;post de l'agile tour&lt;/a&gt;, une fois qu'on utilise les pratiques agiles, il est difficile de s'en passer, et pire, de devoir revenir en arrière.&lt;/p&gt;


&lt;p&gt;A l'heure d'aujourd'hui, particulièrement en France, les entreprises utilisant des méthodes agiles sont encore assez rares.
Grâce à des journées de présentation et de sensibilité à ces nouvelles pratiques (je pense notamment à l'&lt;a href=&quot;http://agiletour.com/&quot; hreflang=&quot;fr&quot;&gt;agile tour&lt;/a&gt; ou encore, au prochain sujet du &lt;a href=&quot;http://www.nantesjug.org/&quot; hreflang=&quot;fr&quot;&gt;JUG Nantes&lt;/a&gt;), les choses sont en train de bouger, progressivement, mais sûrement…&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.netapsys.fr/index.php/post/2009/10/18/Premier-retour-apres-un-premier-mois-chez-Netapsys#comment-form</comments>
      <wfw:comment>http://blog.netapsys.fr/index.php/post/2009/10/18/Premier-retour-apres-un-premier-mois-chez-Netapsys#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.netapsys.fr/index.php/feed/rss2/comments/112</wfw:commentRss>
      </item>
    
  <item>
    <title>Netapsys a 5 ans !</title>
    <link>http://blog.netapsys.fr/index.php/post/2009/05/29/Netapsys-a-5-ans</link>
    <guid isPermaLink="false">urn:md5:aefcf53e335841cd311d8fa6cdc49caf</guid>
    <pubDate>Fri, 29 May 2009 15:31:00 +0200</pubDate>
    <dc:creator>Bénédicte Guignard</dc:creator>
        <category>Netapsys</category>
        <category>anniversaire</category><category>netapsys</category>    
    <description>&lt;p&gt;Créée en mai 2004, Netapsys fête cette année son 5ème anniversaire. L’événement a été dignement célébré hier soir par l’ensemble des collaborateurs Netapsys.&lt;/p&gt;    &lt;p&gt;C'est à l’Hôtel Bel Ami, à Saint Germain des Prés, que nous avions tous rendez-vous. Accueillis par l’équipe de Chef à la maison, nous avons été priés, à notre arrivée, de nous laver les mains et chacun s’est vu remettre un tablier et une toque.
Au programme&amp;nbsp;: la préparation du dîner d’anniversaire de Netapsys!&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://blog.netapsys.fr/public/images/5 ans de Netapsys/.IMG_5566_s.jpg&quot; alt=&quot;IMG_5566.JPG&quot; style=&quot;display:block; margin:0 auto;&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Deux groupes ont été constitués&amp;nbsp;: le premier a eu la charge de préparer 43 entrées (Gaspacho «&amp;nbsp;minute », chantilly au basilic et ses tartines de saumon fumé) et les légumes «&amp;nbsp;Wok&amp;nbsp;» du plat principal&amp;nbsp;; le second groupe a eu la responsabilité de préparer les pintades au gingembre confit et les 43 desserts (Moelleux au chocolat sorbet exotique, coulis de fruits rouges et tuile carambar).&lt;/p&gt;


&lt;p&gt;Tout le monde s’est prêté au jeu et des talents ont été révélés&amp;nbsp;!&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://blog.netapsys.fr/public/images/5 ans de Netapsys/.IMG_5590_s.jpg&quot; alt=&quot;IMG_5590.JPG&quot; /&gt; &lt;img src=&quot;http://blog.netapsys.fr/public/images/5 ans de Netapsys/.IMG_5616_s.jpg&quot; alt=&quot;IMG_5616.JPG&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Quelques  accidents sont cependant à déplorer&amp;nbsp;: une petite coupure au doigt (mais la pintade a été vaincue et le blessé s’en est tiré avec un petit pansement)&amp;nbsp;; des éclaboussures de préparation de gâteau au chocolat&amp;nbsp;; des œufs montés en neige à la force des poignets… devenus douloureux…&lt;/p&gt;


&lt;p&gt;Mais, le résultat en valait la peine&amp;nbsp;!&lt;/p&gt;


&lt;p&gt;La preuve en images&amp;nbsp;:&lt;/p&gt;


&lt;pre&gt;&lt;a href=&quot;http://blog.netapsys.fr/public/images/5%20ans%20de%20Netapsys/IMG_5653.JPG&quot;&gt;&lt;img src=&quot;http://blog.netapsys.fr/public/images/5 ans de Netapsys/.IMG_5653_s.jpg&quot; alt=&quot;IMG_5653.JPG&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://blog.netapsys.fr/public/images/5%20ans%20de%20Netapsys/IMGP0073.JPG&quot;&gt;&lt;img src=&quot;http://blog.netapsys.fr/public/images/5 ans de Netapsys/.IMGP0073_s.jpg&quot; alt=&quot;PENTAX DIGITAL CAMERA&quot; /&gt;&lt;/a&gt; &lt;a href=&quot;http://blog.netapsys.fr/public/images/5%20ans%20de%20Netapsys/IMG_5667.JPG&quot;&gt;&lt;img src=&quot;http://blog.netapsys.fr/public/images/5 ans de Netapsys/.IMG_5667_s.jpg&quot; alt=&quot;IMG_5667.JPG&quot; /&gt;&lt;/a&gt;&lt;/pre&gt;</description>
    
    
    
          <comments>http://blog.netapsys.fr/index.php/post/2009/05/29/Netapsys-a-5-ans#comment-form</comments>
      <wfw:comment>http://blog.netapsys.fr/index.php/post/2009/05/29/Netapsys-a-5-ans#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.netapsys.fr/index.php/feed/rss2/comments/93</wfw:commentRss>
      </item>
    
  <item>
    <title>Tests JUnit4 combiné avec Spring et Spring MVC en mode transactionnel</title>
    <link>http://blog.netapsys.fr/index.php/post/2009/01/08/Tests-Unitaires-et-dintegration-avec-Junit4-et-Spring-MVC-en-mode-transactionnel</link>
    <guid isPermaLink="false">urn:md5:a20f1b6fc0438b9a6560a953cc84b57f</guid>
    <pubDate>Fri, 17 Apr 2009 16:18:00 +0200</pubDate>
    <dc:creator>Abderrazek CHINE</dc:creator>
        <category>Java</category>
        <category>annotations</category><category>controlleurs</category><category>DAO</category><category>dataSource</category><category>framework</category><category>java</category><category>JEE</category><category>junit4</category><category>Junit4</category><category>netapsys</category><category>servlet</category><category>spring</category><category>Spring</category><category>spring 2.5</category><category>spring MVC</category><category>springframework</category><category>tests dintégration</category><category>tests unitaires</category><category>transaction</category><category>transactionManager</category><category>transactionnel</category><category>Web</category><category>webapp</category>    
    <description>&lt;p&gt;Le titre de ce billet montre bien l'étendue des thèmes variés qui seront traités. Il a pour objectif d'illustrer, à l'aide d'un exemple assez complet et proche des cas réels, la mise en place des tests, en mode transactionnel, pour les différentes couches applicatives. Ainsi les vraies difficultés rencontrées par les développeurs seront évoquées.
&lt;br /&gt;
Le billet traite &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/JUnit4&quot;&gt;JUnit4&lt;/a&gt; enrichi avec les annotations de &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/Spring&quot;&gt;Spring&lt;/a&gt; 2.5+ et ses lanceurs pour exécuter facilement les tests.
Des illustrations en mode transactionnel vous sont proposées à la fin de ce billet.&lt;br /&gt;
Le framework JUnit est l'oeuvre conjointe de Kent Beck (créateur de XP) et Erich Gamma (auteur des Design Patterns).&lt;br /&gt;
Avec la version 4, JUnit tente de rattraper son retard sur Testng tout en gardant la compatibilité avec JUnit3x ainsi qu'une parfaite intégration aux éditeurs Eclipse, Netbeans, ...
&lt;br /&gt;
Avec les lanceurs de spring, les tests deviennent plus attrayants. Spring encourage ainsi à adopter l'approche TDD &quot;Test Driven Design&quot; ou &quot;Test-First Developpment&quot;. &lt;br /&gt;
Notez que le jdk5+ est nécessaire pour certaines parties de code Java. Les commentaires dans le code java le mentionnent au bon endroit.
&lt;br /&gt;&lt;/p&gt;    &lt;p&gt;Le framework JUnit est l'oeuvre conjointe de Kent Beck (créateur de XP) et Erich Gamma (auteur des Design Patterns).&lt;br /&gt;
Avec la version 4, JUnit tente de rattraper son retard sur Testng tout en gardant la compatibilité avec JUnit3x ainsi qu'une parfaite intégration aux éditeurs Eclipse, Netbeans, ...
&lt;br /&gt;
&lt;br /&gt;
La pratique des tests unitaires est l'un des principes des méthodes agiles. Il semble que tous les nouveaux frameworks renforcent le principe de testabilité de toutes les couches applicatives.
&lt;br /&gt;
Avec JUnit4 et Spring, les tests, en particulier d'intégration, deviennent aisés. Ceux ayant pratiqués les tests savent bien les efforts nécessaires afin de tester certaines couches( par exemple, la couche de persistance ou &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/DAO&quot;&gt;DAO&lt;/a&gt;).
&lt;br /&gt;
Citons au passage, qu' un critère majeur permettant de juger de la suffisance des tests peut être&amp;nbsp;:
&lt;br /&gt;
&lt;em&gt;L'investissement fait en tests doit être égal à celui passé sur le design. Et si le design répond facilement au changement alors les tests sont suffisants&lt;/em&gt;.
&lt;br /&gt;
L'un des avantages des tests est d'avoir un retour (feedback) rapide et beaucoup moins cher sur les réglages à apporter au logiciel et ainsi d'anticiper les anomalies.
&lt;br /&gt;
Le second avantage des tests (unitaires et d'intégration) est de limiter le nombre d'itérations (en phase recette/production) de mise en conformité du logiciel.&lt;br /&gt;
Et, par conséquent, de réduire son coût total. Signalons qu'en phase de mise en recette/production les personnes impliquées sont de diverses compétences d'où le coût économique élevé d'une itération à ce stade!
&lt;br /&gt;
La figure suivante résume les objectifs des différents types de tests pour un projet. &lt;img src=&quot;http://blog.netapsys.fr/public/images/.fig1_schems-tests_s.jpg&quot; alt=&quot;tests-synthese&quot; style=&quot;display:block; margin:0 auto;&quot; /&gt;
&lt;br /&gt;
La bonne compréhension de ce billet nécessite d'avoir certains pré-requis énoncés plus loin. A défaut, au préalable, lire &lt;a href=&quot;http://blog.netapsys.fr/index.php/post/2008/04/13/Introduction-A-Spring-MVC&quot; hreflang=&quot;fr&quot;&gt;article&lt;/a&gt; sur le blog &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/Netapsys&quot;&gt;Netapsys &lt;/a&gt;. Par contre, l'utilisation de &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/Spring&quot;&gt;Spring&lt;/a&gt; avec JUnit4 n'exige en aucun cas de maîtriser &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/Spring&quot;&gt;Spring&lt;/a&gt;.
&lt;br /&gt;
&lt;br /&gt;
Dans l'exemple détaillé plus loin, Spring 2.5 allège considérablement la configuration XML. &lt;br /&gt;
De plus, les principes &quot;ZERO CONFIGURATION&quot; et/ou &quot;CONVENTION OVER CONFIGURATION&quot; permettent d'alléger plus les fichiers de configuration xml.
&lt;br /&gt;
La présentation de ce billet est divisée en trois grandes parties:
&lt;br /&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Créer une application Web &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/Java&quot;&gt;Java&lt;/a&gt; &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/JEE&quot;&gt;JEE&lt;/a&gt; avec Maven2, &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/SpringMVC&quot;&gt;SpringMVC&lt;/a&gt; et ses annotations (en particulier &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/%40Controller&quot;&gt;@Controller&lt;/a&gt;) (Voir &lt;a href=&quot;http://blog.netapsys.fr/index.php/post/2008/04/13/Introduction-A-Spring-MVC&quot; hreflang=&quot;fr&quot;&gt;article&lt;/a&gt; sur le blog &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/Netapsys&quot;&gt;Netapsys &lt;/a&gt; pour les étapes de création d’un projet sous eclipse avec maven2)&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Mettre en place, via le &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/framework&quot;&gt;framework&lt;/a&gt; &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/JUnit4&quot;&gt;JUnit4&lt;/a&gt;.x, des &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/tests%20unitaires&quot;&gt;tests unitaires&lt;/a&gt; et des &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/tests%20dint%C3%A9gration&quot;&gt;tests d'intégration&lt;/a&gt; couvrant l'ensemble des couches applicatives (couches Dao, Service et Web en SpringMVC)&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Enfin,  exécution des tests en mode &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/transaction&quot;&gt;transaction&lt;/a&gt;nel. Les codes sources présentés sont disponibles en annexe&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;PREREQUIS&lt;/strong&gt;
&lt;br /&gt;
&lt;br /&gt;
Les pré-requis suivants aideront à lire facilement ce billet. Mais tous ne sont pas nécessaires à sa compréhension.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Connaissance des applications Web dans le monde JEE (servlet, jsp..)&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Connaissance sommaire de &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/Spring&quot;&gt;Spring&lt;/a&gt;, &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/Spring%20MVC&quot;&gt;Spring MVC&lt;/a&gt; avec ses &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/annotations&quot;&gt;annotations&lt;/a&gt;&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Connaissance sommaire de &lt;a href=&quot;http://blog.netapsys.fr/index.php/tag/JUnit4.x&quot;&gt;JUnit4.x&lt;/a&gt; avec ses annotations&amp;nbsp;;&lt;/li&gt;
&lt;li&gt;Connaissance sommaire de la notion de transaction.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ETAPE 1. Application Web avec Spring MVC&lt;/strong&gt;
&lt;br /&gt;
&lt;br /&gt;
Pour toute la suite, l’application Web exemple sera nommée «spring-mvc-webapp». C’est le nom de la servlet frontale dans le fichier web.xml.
&lt;br /&gt;
Commençons par configurer le fichier &lt;em&gt;web.xml&lt;/em&gt; dont voici le contenu (certaines lignes peuvent encore être simplifiées mais sont laissées ici pour une meilleure compréhension)&amp;nbsp;:
&lt;br /&gt;&lt;/p&gt;
&lt;pre class=&quot;xml&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;web-app&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;context-param&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;param-name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;contextConfigLocation&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/param-name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;param-value&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
/WEB-INF/spring-mvc-webapp-servlet.xml, classpath:/spring.xml
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/param-value&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/context-param&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 
&amp;nbsp;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;listener&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;listener-class&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;org.springframework.web.context.ContextLoaderListener&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/listener-class&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/listener&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- déclare la servlet frontal --&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;servlet&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;servlet-name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;spring-mvc-webapp&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/servlet-name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;servlet-class&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;org.springframework.web.servlet.DispatcherServlet&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/servlet-class&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;load-on-startup&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;1&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/load-on-startup&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/servlet&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 
 &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- les requêtes se terminant par .html sont servies par cette servlet --&amp;gt;&lt;/span&gt;&lt;/span&gt; 
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;servlet-mapping&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;servlet-name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;spring-mvc-webapp&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/servlet-name&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;url-pattern&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;*.html&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/url-pattern&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/servlet-mapping&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/web-app&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;Notons que l'arborescence du projet sera donnée dans l'annexe de ce billet.
&lt;br /&gt;
La partie 'contextConfigLocation' sera explicitée plus loin&amp;nbsp;: on reviendra en détail sur les fichiers spring*.xml.
&lt;br /&gt;
Le «listener» permet de configurer le contexte du Spring MVC.
&lt;br /&gt;
Le bloc &quot;&amp;lt;servlet&amp;gt;...&amp;lt;/servlet&amp;gt;&quot; permet d'identifier la servlet frontale de Spring MVC chargée de répondre à toutes les requêtes (*.html) d'un client de l’application Web.
&lt;br /&gt;
La section suivante détaille le fichier «spring-mvc-webapp-servlet.xml», nommé ainsi conformément à la convention.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;ETAPE 2. Configuration de Spring MVC&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;Le fichier «spring-mvc-webapp-servlet.xml» doit contenir ces lignes&amp;nbsp;:
&lt;br /&gt;&lt;/p&gt;
&lt;pre class=&quot;xml&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;encoding&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- Fichier de conf du contexte d'application pour Spring (fichier nommé spring-mvc-webapp-servlet.xml selon la convention. --&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;beans&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;xmlns&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.springframework.org/schema/beans&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;xmlns:xsi&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/span&gt;
		&lt;span style=&quot;color: #000066;&quot;&gt;xmlns:p&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.springframework.org/schema/p&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;xmlns:context&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.springframework.org/schema/context&amp;quot;&lt;/span&gt;
		&lt;span style=&quot;color: #000066;&quot;&gt;xsi:schemaLocation&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
				http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd&amp;quot;&lt;/span&gt;
				&lt;span style=&quot;color: #000066;&quot;&gt;default-autowire&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;byName&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- - Tous les controlleurs sont automatiquement détectés grâce à l'annotation @Controller.
		- On définit ici dans quel package le post processor doit chercher ces beans annotés.	--&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
  	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;context:component-scan&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;base-package&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;com.netapsys.fr.springmvc.web&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;	  	
&amp;nbsp;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- Activates various annotations to be detected in bean classes: Spring's
		@Required and @Autowired, as well as JSR 250's @PostConstruct,@PreDestroy and 
		@Resource (if available) and JPA's @PersistenceContext &amp;amp; @PersistenceUnit.
	--&amp;gt;&lt;/span&gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;context:annotation-config&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!--
		- Les controlleurs de cette application fournissent une annotation @RequestMapping 
		- Ils peuvent être déclarés de deux manière différentes:
		-  Au niveau de la classe : 
		-      par exemple @RequestMapping(&amp;quot;/addVisit.html&amp;quot;)
		-      Pour ce type de controlleurs on peut annoter les méthodes pour une requete Post ou Get,
		- Au niveau de chaque méthode. Différents exemples seront fournis.
	--&amp;gt;&lt;/span&gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;bean&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!--
		Ceci est le view resolver, il permet de définir la technologie de vue utilisée et comment
		sélectionner une vue. On prendra ici la solution la plus simple : elle permet de mapper 
		le nom de la vue retournée avec la sélection d'une jsp. Ex. : si le nom de la vue retournée est &amp;quot;hello&amp;quot; alors on utilisera le fichier
		WEB-INF/jsp/hello.jsp pour construire la vue. 
	--&amp;gt;&lt;/span&gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;bean&lt;/span&gt; 
	 &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;org.springframework.web.servlet.view.InternalResourceViewResolver&amp;quot;&lt;/span&gt; 
	 &lt;span style=&quot;color: #000066;&quot;&gt;p:prefix&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;/WEB-INF/jsp/&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;p:suffix&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;.jsp&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/beans&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
En dehors des commentaires et explications, ce fichier contient peu de lignes. Et même si le projet continue à grossir, ce fichier de configuration n'évolue que très peu.
&lt;br /&gt;
Soulignons que l’emploi des namespaces (par exemple mlns:context) réduit énormément la verbosité de la configuration XML de Spring.
&lt;br /&gt;
La dernière ligne définit la vue retournée en réponse à une requête http.
&lt;br /&gt;
&lt;em&gt;Remarque importante&lt;/em&gt;: dans le fichier web.xml déjà présenté, la variable «contextConfigLocation» pointe, entre autres, vers le fichier &quot;spring.xml&quot;. Et ceci afin que le contexte de l’application Web charge aussi d’autres beans nécessaires. Attention, en l'absence de cette indication, vous seriez en face d’exceptions difficiles à déchiffrer&amp;nbsp;!
&lt;br /&gt;
La classe du &quot;controller de SpringMVC&quot; est nommée &quot;ClientControllerSpringMVC.java&quot;. Le controller se charge de traiter les requêtes transmises par la servlet dispatcher de SpringMVC en réponse aux requêtes http du client de l'application web.
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;Controller de spring MVC&lt;/strong&gt;
&lt;br /&gt;
Le code de la classe multi-controller Spring mVC &quot;ClientControllerSpringMVC.java&quot; est comme suit:
&lt;br /&gt;&lt;/p&gt;
&lt;pre class=&quot;java&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;package&lt;/span&gt; com.&lt;span style=&quot;color: #006600;&quot;&gt;netapsys&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;fr&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;springmvc&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;web&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.apache.log4j.Logger;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.beans.factory.annotation.Autowired;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.stereotype.Controller;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.ui.ModelMap;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.validation.BindingResult;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.web.bind.annotation.ModelAttribute;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.web.bind.annotation.RequestMapping;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.web.bind.annotation.RequestMethod;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.web.bind.annotation.RequestParam;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.web.bind.support.SessionStatus;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmcv.entites.Client;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmvc.exceptions.MyException;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmvc.service.MyService;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmvc.tb.constants.Constants;&lt;/span&gt;
&amp;nbsp;
@Controller&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;clientControllerSpring&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; ClientControllerSpringMVC &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; MyService myService&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	@Autowired
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; setMyService&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;MyService myService&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;myService&lt;/span&gt; = myService&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; Logger logger=Logger.&lt;span style=&quot;color: #006600;&quot;&gt;getLogger&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;getClass&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;getName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**
	 * Handler de la méthode Get pour l'URL /getClientSpringMVC.html. 
	 * @param nom le nom du theme affiché dans la vue.
	 * @param prenom 
	 * @param model une map de toutes les données qui seront utilisables dans la vue 
	 * @return le &amp;lt;code&amp;gt;Constants.SUCCESS or Constants.ECHEC&amp;lt;/code&amp;gt; nom de la vue qu'il faudra utiliser.
	 */&lt;/span&gt;
	@RequestMapping&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;value=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;/getClient.html&amp;quot;&lt;/span&gt;,method = RequestMethod.&lt;span style=&quot;color: #006600;&quot;&gt;GET&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt;  &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; getClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;@RequestParam&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;value=Constants.&lt;span style=&quot;color: #006600;&quot;&gt;ATTRIBUTE_NAME&lt;/span&gt;,required=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom,
			@RequestParam&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;value=Constants.&lt;span style=&quot;color: #006600;&quot;&gt;ATTRIBUTE_LASTNAME&lt;/span&gt;,required=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom,ModelMap model&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		Client client=myService.&lt;span style=&quot;color: #006600;&quot;&gt;getClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;nom, prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;client&lt;span style=&quot;color: #66cc66;&quot;&gt;!&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
			logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&amp;gt;Client '&amp;quot;&lt;/span&gt;+prenom+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;+nom+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;'  existe.&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
			model.&lt;span style=&quot;color: #006600;&quot;&gt;addAttribute&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;client&amp;quot;&lt;/span&gt;,client&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; Constants.&lt;span style=&quot;color: #006600;&quot;&gt;SUCCESS&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt; 
		&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
			model.&lt;span style=&quot;color: #006600;&quot;&gt;addAttribute&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;errorMsg&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Client '&amp;quot;&lt;/span&gt;+prenom+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;+nom+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;' inexistant&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; Constants.&lt;span style=&quot;color: #006600;&quot;&gt;ECHEC&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	@RequestMapping&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;value=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;/createClient.html&amp;quot;&lt;/span&gt;,method = RequestMethod.&lt;span style=&quot;color: #006600;&quot;&gt;GET&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; createClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;	@RequestParam&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;value=Constants.&lt;span style=&quot;color: #006600;&quot;&gt;ATTRIBUTE_NAME&lt;/span&gt;,required=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom,
			@RequestParam&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;value=Constants.&lt;span style=&quot;color: #006600;&quot;&gt;ATTRIBUTE_LASTNAME&lt;/span&gt;,required=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom,	ModelMap model&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		Client client=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;try&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
			client=myService.&lt;span style=&quot;color: #006600;&quot;&gt;createClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; nom, prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;catch&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;MyException e&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;e.&lt;span style=&quot;color: #006600;&quot;&gt;printStackTrace&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;			
		model.&lt;span style=&quot;color: #006600;&quot;&gt;addAttribute&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;client&amp;quot;&lt;/span&gt;,client&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;client created=&amp;quot;&lt;/span&gt;+client&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; Constants.&lt;span style=&quot;color: #006600;&quot;&gt;SUCCESS&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	@RequestMapping&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;value=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;/updateClient.html&amp;quot;&lt;/span&gt;,method = RequestMethod.&lt;span style=&quot;color: #006600;&quot;&gt;POST&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; updateClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;	@ModelAttribute&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;client&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; Client client,BindingResult result, SessionStatus status&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Client to update &amp;quot;&lt;/span&gt;+client.&lt;span style=&quot;color: #006600;&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		myService.&lt;span style=&quot;color: #006600;&quot;&gt;updateClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;	client.&lt;span style=&quot;color: #006600;&quot;&gt;getCliId&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;, client.&lt;span style=&quot;color: #006600;&quot;&gt;getCliNom&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;,client.&lt;span style=&quot;color: #006600;&quot;&gt;getCliPrenom&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		status.&lt;span style=&quot;color: #006600;&quot;&gt;setComplete&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&amp;gt;&amp;gt;Client update OK&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
Notez que la classe est annotée avec le stéréotype @Controller. Ainsi ses méthodes vont être analysées par la servlet dispatcher pour traiter toutes les requêtes(*.html). L'auto-détection de Spring2.5 va scanner, via &amp;lt;context:component-scan&amp;gt; du fichier spring-mvc-webapp-servlet.xml, les beans dans les packages mentionnés.
&lt;br /&gt;
Noter également la présence d'autres stéréotypes @repository ou @Service qui sont commentés dans le code java.
&lt;br /&gt;
Mises à part les annotations @RequestMapping et @RequestParam, le &quot;controller&quot; ne fait qu'appeler les méthodes de la couche service.
&lt;br /&gt;
Cette dernière couche est détaillée ci-après. Mais avant cela, la section suivante présente le contenu du fichier spring.xml.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ETAPE 3. Configuration Spring des beans des couches DAO et Service&lt;/strong&gt;
&lt;br /&gt;
&lt;br /&gt;
Le fichier de configuration Spring nommé spring.xml (pas de convention ici !) sert à déclarer les beans métier qui seront consommés par l’application Web.
Il indique les packages java à scanner pour l'auto-injection de ces beans. Enfin, il déclare une dataSource pour la couche DAO.&lt;/p&gt;

&lt;pre class=&quot;xml&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;?xml&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;version&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;encoding&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- spring.xml --&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;beans&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;xmlns&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.springframework.org/schema/beans&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;xmlns:xsi&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/span&gt;
		&lt;span style=&quot;color: #000066;&quot;&gt;xmlns:p&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.springframework.org/schema/p&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;xmlns:context&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.springframework.org/schema/context&amp;quot;&lt;/span&gt;
		&lt;span style=&quot;color: #000066;&quot;&gt;xmlns:tx&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.springframework.org/schema/tx&amp;quot;&lt;/span&gt;
		&lt;span style=&quot;color: #000066;&quot;&gt;xmlns:aop&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.springframework.org/schema/aop&amp;quot;&lt;/span&gt;
		&lt;span style=&quot;color: #000066;&quot;&gt;xsi:schemaLocation&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
		http://www.springframework.org/schema/aop http://www.springframework.org/schema/tx/spring-aop-2.5.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd&amp;quot;&lt;/span&gt;
		&lt;span style=&quot;color: #000066;&quot;&gt;__default-autowire__&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;byName&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!--
		Activates various annotations to be detected in bean classes: Spring's
		@Required and @Autowired, as well as JSR 250's @PostConstruct,
		@PreDestroy and @Resource (if available) and JPA's @PersistenceContext
		and @PersistenceUnit (if available).
	--&amp;gt;&lt;/span&gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;context:annotation-config&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;context:component-scan&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;base-package&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;com.netapsys.fr.springmvc.dao&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
        &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;context:component-scan&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;base-package&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;com.netapsys.fr.springmvc.service&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;bean&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;dataSource&amp;quot;&lt;/span&gt; 
		&lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;org.apache.commons.dbcp.BasicDataSource&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;driverClassName&amp;quot;&lt;/span&gt;
			&lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;com.mysql.jdbc.Driver&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/property&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;url&amp;quot;&lt;/span&gt;
			&lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;jdbc:mysql://localhost:3306/test&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/property&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;username&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;root&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/property&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
		&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;password&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;value&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;root&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/property&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/bean&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/beans&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ETAPE 4. Classes DAO et Service &lt;/strong&gt;
&lt;br /&gt;
&lt;br /&gt;
- Couche DAO&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;Notez que cette couche utilise deux classes beans d'entités ( Client.java et Personne.java). Leurs codes, simples, sont donnés en annexe.&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
Le code de l'interface IDao.java contient&amp;nbsp;:
&lt;br /&gt;&lt;/p&gt;
&lt;pre class=&quot;java&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;package&lt;/span&gt; com.&lt;span style=&quot;color: #006600;&quot;&gt;netapsys&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;fr&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;springmvc&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;dao&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmcv.entites.Client;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmvc.exceptions.MyException;&lt;/span&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;interface&lt;/span&gt; IDao  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span style=&quot;color: #993333;&quot;&gt;boolean&lt;/span&gt; isExistId&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: #993333;&quot;&gt;boolean&lt;/span&gt; findByName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
  Client getClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
  Client getClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom,&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
  Client getClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
  Client createClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom, &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;throws&lt;/span&gt; MyException&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
  Client updateClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; id,&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom, &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
  &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; deleteClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;&lt;br /&gt;
Et l'implémentation de cette interface est faite dans la classe DaoImpl.java qui contient les lignes suivantes&amp;nbsp;:
&lt;br /&gt;&lt;/p&gt;
&lt;pre class=&quot;java&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;package&lt;/span&gt; com.&lt;span style=&quot;color: #006600;&quot;&gt;netapsys&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;fr&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;springmvc&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;dao&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import java.sql.ResultSet;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import java.sql.SQLException;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import javax.sql.DataSource;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.apache.log4j.Logger;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.beans.factory.annotation.Autowired;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.dao.DataAccessException;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.jdbc.core.simple.ParameterizedRowMapper;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.stereotype.Repository;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmcv.entites.Client;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmvc.tb.constants.Constants;&lt;/span&gt;
@&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;Repository&lt;/span&gt; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/** @Repository  un marqueur Spring pour, entre autres, auto-translater les exception de la couche de persistance.**/&lt;/span&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; DaoImpl &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;implements&lt;/span&gt; IDao&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; Logger logger = Logger.&lt;span style=&quot;color: #006600;&quot;&gt;getLogger&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;getClass&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;getName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**
	 * spring template for jdbc (jdk 5ou+)
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; SimpleJdbcTemplate jt=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;	
	@SuppressWarnings&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;unused&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; DataSource dataSource&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	@Autowired
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; setDataSource&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;DataSource dataSource&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//Recommandation de spring: Initialiser SimpleJdbcTemplate ici avec new lorsqu'une seule datasource est nécessaire!&lt;/span&gt;
		jt=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; SimpleJdbcTemplate&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;dataSource&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/* (non-Javadoc)
	 * @see com.netapsys.springmvc.metier.IService#getClient(java.lang.String)
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; Client getClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; getClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;nom,&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; Client getClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; getClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;valueOf&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;	
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;	
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; Client getClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom, &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; sql=Constants.&lt;span style=&quot;color: #006600;&quot;&gt;SQL_REQUETE_CLIENT&lt;/span&gt; + &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;  WHERE upper(CLINOM)='&amp;quot;&lt;/span&gt;+nom.&lt;span style=&quot;color: #006600;&quot;&gt;toUpperCase&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;!&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;equals&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; 
			sql+=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; AND upper(CLIPRENOM)='&amp;quot;&lt;/span&gt;+prenom.&lt;span style=&quot;color: #006600;&quot;&gt;toUpperCase&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;!&lt;/span&gt;findByName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;nom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Client&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//Si nom n existe pas dans bd renvoie null;&lt;/span&gt;
		&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
		ParameterizedRowMapper&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;lt;&lt;/span&gt;Client&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;gt;&lt;/span&gt;  mapper=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; ParameterizedRowMapper&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;lt;&lt;/span&gt;Client&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; Client mapRow&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;ResultSet&lt;/span&gt; rs,&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; rowNm&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;throws&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;SQLException&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;				
				&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; populateClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;rs&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;				
			&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
		&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		Client client=jt.&lt;span style=&quot;color: #006600;&quot;&gt;queryForObject&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;sql, mapper&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;get Client = &amp;quot;&lt;/span&gt;+client&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; client&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; Client populateClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;ResultSet&lt;/span&gt; rs&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;throws&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;SQLException&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;rs==&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		Client client=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Client&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		client.&lt;span style=&quot;color: #006600;&quot;&gt;setCliId&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;  rs.&lt;span style=&quot;color: #006600;&quot;&gt;getLong&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;cliId&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;      &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		client.&lt;span style=&quot;color: #006600;&quot;&gt;setNom&lt;/span&gt;   &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;  rs.&lt;span style=&quot;color: #006600;&quot;&gt;getString&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;cliNom&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;   &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		client.&lt;span style=&quot;color: #006600;&quot;&gt;setPrenom&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; rs.&lt;span style=&quot;color: #006600;&quot;&gt;getString&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;cliPrenom&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; client&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/* (non-Javadoc)
	 * @see com.netapsys.springmvc.metier.IDao#createClient(long, java.lang.String, java.lang.String)
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; Client createClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom, &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		Client client=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Client&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		client.&lt;span style=&quot;color: #006600;&quot;&gt;setNom&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;nom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		client.&lt;span style=&quot;color: #006600;&quot;&gt;setPrenom&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;			
			jt.&lt;span style=&quot;color: #006600;&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; Constants.&lt;span style=&quot;color: #006600;&quot;&gt;SQL_REQUETE_INSERT_CLIENT&lt;/span&gt;+ &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;'&amp;quot;&lt;/span&gt;+nom+ &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;' , '&amp;quot;&lt;/span&gt;+prenom+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;'&amp;quot;&lt;/span&gt; +&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;)&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; id=jt.&lt;span style=&quot;color: #006600;&quot;&gt;queryForLong&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;select LAST_INSERT_ID()&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt; 			&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//Mysql retrieve the last id inserted&lt;/span&gt;
			client.&lt;span style=&quot;color: #006600;&quot;&gt;setCliId&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; client&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;DataAccessException e&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
			logger.&lt;span style=&quot;color: #006600;&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; e.&lt;span style=&quot;color: #006600;&quot;&gt;getMessage&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/* 
	 * @see com.netapsys.springmvc.metier.IService#exist(java.lang.String)
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;boolean&lt;/span&gt; isExistId&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; sql = Constants.&lt;span style=&quot;color: #006600;&quot;&gt;SQL_REQUETE_COUNT_CLIENT&lt;/span&gt;+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; WHERE cliId='&amp;quot;&lt;/span&gt; +id + &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; count = jt.&lt;span style=&quot;color: #006600;&quot;&gt;queryForInt&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;sql&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; count &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;?&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt; : &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;boolean&lt;/span&gt; findByName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;		
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; findByName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;nom,&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;boolean&lt;/span&gt; findByName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom,&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;		
&amp;nbsp;
		&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; sql = Constants.&lt;span style=&quot;color: #006600;&quot;&gt;SQL_REQUETE_COUNT_CLIENT&lt;/span&gt;+
				&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; WHERE UPPER(cliNom)='&amp;quot;&lt;/span&gt; +nom.&lt;span style=&quot;color: #006600;&quot;&gt;toUpperCase&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;!&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;equals&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
			sql+=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; AND UPPER(CLIPRENOM)='&amp;quot;&lt;/span&gt;+prenom.&lt;span style=&quot;color: #006600;&quot;&gt;toUpperCase&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; + &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; count = jt.&lt;span style=&quot;color: #006600;&quot;&gt;queryForInt&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;sql&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; count &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;?&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt; : &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; deleteClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; sql=Constants.&lt;span style=&quot;color: #006600;&quot;&gt;SQL_DELETE_ALL_CLIENT&lt;/span&gt;+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; WHERE cliId='&amp;quot;&lt;/span&gt;+ id + &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;		
		jt.&lt;span style=&quot;color: #006600;&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;sql&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; Client updateClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; id, &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom, &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		Client client=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; Client&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		client.&lt;span style=&quot;color: #006600;&quot;&gt;setCliId&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		client.&lt;span style=&quot;color: #006600;&quot;&gt;setCliNom&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;nom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		client.&lt;span style=&quot;color: #006600;&quot;&gt;setCliPrenom&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; sql=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;update Client set clinom='&amp;quot;&lt;/span&gt;+
				nom+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;', cliprenom='&amp;quot;&lt;/span&gt;+prenom+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;' WHERE cliId='&amp;quot;&lt;/span&gt;+id+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;nb rows updated=&amp;quot;&lt;/span&gt;+jt.&lt;span style=&quot;color: #006600;&quot;&gt;update&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;sql&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; client&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
- Couche service&amp;nbsp;:
&lt;br /&gt;
&lt;br /&gt;
Enfin, la couche service contient, en dehors de son interface identique à celle de IDao, la classe d'implémentation nommée &lt;em&gt;MyService.java&lt;/em&gt; dont voici son code:
&lt;br /&gt;&lt;/p&gt;
&lt;pre class=&quot;java&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;package&lt;/span&gt; com.&lt;span style=&quot;color: #006600;&quot;&gt;netapsys&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;fr&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;springmvc&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;service&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.beans.factory.annotation.Autowired;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.stereotype.Service;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmcv.entites.Client;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmvc.dao.DaoImpl;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmvc.exceptions.MyException;&lt;/span&gt;
@Service&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; MyService &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;implements&lt;/span&gt; IService&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; serialVersionUID = 1L&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**	 * @see com.netapsys.fr.springmvc.dao.DaoImpl	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; DaoImpl daoImpl&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	@Autowired
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; setDaoImpl&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;DaoImpl daoImpl&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;daoImpl&lt;/span&gt; = daoImpl&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; Client getClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom, &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; daoImpl.&lt;span style=&quot;color: #006600;&quot;&gt;getClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;nom, prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;boolean&lt;/span&gt; isExistId&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;	
		&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;// Valider les regles de gestion .....if id is not int/long...&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; daoImpl.&lt;span style=&quot;color: #006600;&quot;&gt;isExistId&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;boolean&lt;/span&gt; findByName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; daoImpl.&lt;span style=&quot;color: #006600;&quot;&gt;findByName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;nom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; Client getClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; daoImpl.&lt;span style=&quot;color: #006600;&quot;&gt;getClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;nom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; Client createClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom, &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;throws&lt;/span&gt; MyException &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; daoImpl.&lt;span style=&quot;color: #006600;&quot;&gt;createClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; nom, prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; deleteClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;		
		 daoImpl.&lt;span style=&quot;color: #006600;&quot;&gt;deleteClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; Client getClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; daoImpl.&lt;span style=&quot;color: #006600;&quot;&gt;getClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;id&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; Client updateClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;long&lt;/span&gt; id, &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom, &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; daoImpl.&lt;span style=&quot;color: #006600;&quot;&gt;updateClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;id, nom, prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
La couche service est là pour appeler les méthodes de la couche DAO. Et c'est dans la couche service que l'on gère l'aspect transactionnel mais également les règles métier spécifiques. On peut faire de même pour tous les apsects transverses tels que les logs et les mesures de temps d'exécution.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ETAPE 5. Fichiers jsp &lt;/strong&gt;
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;Le fichier index.jsp ne fait que rediriger la requête vers l'url  /createClient.html.&lt;/p&gt;


&lt;p&gt;&lt;br /&gt;
La requête /createClient.html est interceptée par la servlet frontale de SpringMVC, qui à son tour décide de l'action (méthode) à appeler dans le &quot;controller&quot; nommé &quot;ClientControllerSpringMVC&quot; et qui décide ensuite de la vue à rendre en réponse à cette requête. Dans notre cas, c'est la méthode &quot;public String createClient&quot; de la classe &quot;ClientControllerSpringMVC.java&quot; qui sera appelée. Celle-ci, en cas de succès renvoie la chaîne &quot;success&quot; stockée dans Constants.SUCCESS de la classe utilitaire Constants. C'est cette chaîne qui permet de traduire la vue gérant la présentation de la réponse, dans notre cas &quot;success.jsp&quot;.
&lt;br /&gt;
&lt;br /&gt;
Voici donc les quelques lignes de index.jsp:
&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;[jsp]
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Spring mvc sample&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;%
    final String urlAction=&amp;quot;/createClient.html?&amp;quot;;
	final String nom = request.getParameter(&amp;quot;name&amp;quot;);
	final String prenom = request.getParameter(&amp;quot;lastName&amp;quot;);
	if (nom != null &amp;amp;&amp;amp; !&amp;quot;&amp;quot;.equals(nom))
		response.sendRedirect(request.getContextPath()
				+ urlAction+&amp;quot;name=&amp;quot; + nom + &amp;quot;&amp;amp;lastName&amp;quot;
				+ prenom);
	else
		response
				.sendRedirect(request.getContextPath()
						+ urlAction+&amp;quot;name=nom007&amp;amp;lastName=prenom007&amp;quot;);
%&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
Le fichier success.jsp:
&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;[jsp]
&amp;lt;body&amp;gt;
&amp;lt;h2&amp;gt;Edition de la fiche client créé   &amp;lt;/h2&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;% final String url=request.getContextPath()+&amp;quot;/updateClient.html&amp;quot;;%&amp;gt;
&amp;lt;form:form commandName=&amp;quot;client&amp;quot; action=&amp;quot;&amp;lt;%=url %&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;
&amp;lt;table&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;form:hidden  path=&amp;quot;cliId&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Nom:&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;form:input tabindex=&amp;quot;1&amp;quot; autocomplete=&amp;quot;true&amp;quot;  path=&amp;quot;cliNom&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Prénom:&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;form:input tabindex=&amp;quot;2&amp;quot; autocomplete=&amp;quot;true&amp;quot;  path=&amp;quot;cliPrenom&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;lt;td colspan=&amp;quot;2&amp;quot;&amp;gt;
&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Valider&amp;quot; /&amp;gt;
&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;/form:form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;Enfin, la source du fichier error.jsp:
&lt;br /&gt;&lt;/p&gt;

&lt;pre&gt;[jsp]
&amp;lt;body&amp;gt;
&amp;lt;%  String msgError=(String)request.getAttribute(&amp;quot;errorMsg&amp;quot;); %&amp;gt;
&amp;lt;br /&amp;gt;&amp;lt;h2&amp;gt; &amp;lt;/h2&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;b&amp;gt;&amp;lt;%=msgError%&amp;gt;&amp;lt;/b&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
Dans success.jsp, l'action du tag &quot;&amp;lt;form:from&quot; pointe sur /updateClient.html avec la méthode http &quot;POST&quot;. La méthode &quot;public String updateClient&quot; du &quot;controller&quot; renvoie constamment &quot;null&quot;. Ainsi, la vue utilisée dans ce cas est /WEB-INF/jsp/updateClient.jsp conformément aux déclarations du fichier spring-mvc-webapp-servlet.xml.
&lt;br /&gt;
Le fichier updateClient.jsp  contient ces lignes:
&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;[jsp]
&amp;lt;body&amp;gt;
&amp;lt;h2&amp;gt;Page Modification client&amp;lt;/h2&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;% 
    final String path=request.getContextPath();
    final String urlAction=path+&amp;quot;/updateClient.html&amp;quot;;
%&amp;gt;
&amp;lt;form:form commandName=&amp;quot;client&amp;quot; action=&amp;quot;&amp;lt;%=urlAction %&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;
&amp;lt;table border=0&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td colspan=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;form:hidden  path=&amp;quot;cliId&amp;quot; id=&amp;quot;id&amp;quot;/&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;Nom:&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;form:input  autocomplete=&amp;quot;true&amp;quot;  path=&amp;quot;cliNom&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;Prénom:&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;form:input  autocomplete=&amp;quot;true&amp;quot;  path=&amp;quot;cliPrenom&amp;quot; /&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td colspan=&amp;quot;2&amp;quot;&amp;gt;
&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Valider&amp;quot; /&amp;gt;
&amp;lt;/td&amp;gt;
&amp;lt;/tr&amp;gt;
&amp;lt;/table&amp;gt;
&amp;lt;/form:form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ETAPE 6. Tests de l'application web &lt;/strong&gt;
&lt;br /&gt;
Pour tester l'application web ainsi complétée, nous allons lancer une console dos, puis se positionner dans le répertoire du projet et lancer la commande&amp;nbsp;:
&lt;br /&gt;&lt;/p&gt;
&lt;pre&gt;[sh]
mvn jetty:run
&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
S'assurer que la base Mysql nommée test (contenant une table client avec trois champs cliId, cliNom et cliPrenom) est en service.
&lt;br /&gt;Puis lancer le navigateur web avec l'url &quot;http://localhost:8080/spring-mvc-webapp/index.jsp&quot;.
&lt;br /&gt;
Vous devez obtenir la figure ci-contre &lt;img src=&quot;http://blog.netapsys.fr/public/code/JUnit4EtSpringMVC/resultat-index.PNG&quot; alt=&quot;capture-indexjsp&quot; /&gt; .
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ETAPE 7. Classe de test du controlleur SpringMVC &lt;/strong&gt;
&lt;br /&gt;
&lt;br /&gt;
La classe JUnit4, nommée &quot;ClientControllerSpringMVCTest.java&quot;, permet de tester le &quot;controller&quot; de SpringMVC. Elle est constituée des lignes suivantes&amp;nbsp;:
&lt;br /&gt;&lt;/p&gt;
&lt;pre class=&quot;java&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/*-- Attention, les puristes de Junit ne verront pas les assert ici!!!!!! */&lt;/span&gt; 
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;package&lt;/span&gt; com.&lt;span style=&quot;color: #006600;&quot;&gt;netapsys&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;tests&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;springmvc&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;web&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;tests&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.apache.log4j.Logger;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.junit.After;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.junit.AfterClass;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.junit.Before;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.junit.BeforeClass;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.junit.Test;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.junit.runner.RunWith;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.beans.factory.annotation.Autowired;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.test.context.ContextConfiguration;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.ui.ModelMap;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmvc.tb.constants.Constants;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmvc.web.ClientControllerSpringMVC;&lt;/span&gt;
@ContextConfiguration&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;locations=&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;classpath:/config/spring-mvc-webapp-tests.xml&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;classpath:/config/spring-test.xml&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
@RunWith&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; SpringJUnit4ClassRunner.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//to activate autowiring injection dependence&lt;/span&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; ClientControllerSpringMVCTest  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;static&lt;/span&gt; Logger logger =Logger.&lt;span style=&quot;color: #006600;&quot;&gt;getLogger&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;ClientControllerSpringMVCTest.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;getClass&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;getName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**
	 * Attribute in url, ex. &amp;quot;/getClient.html?name=Agent007
	 */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; NAME2TEST=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Agent007&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; LASTNAME2TEST=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;007&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;static&lt;/span&gt; ModelMap model&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;protected&lt;/span&gt;  ClientControllerSpringMVC clientControllerSpring&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**
	 * auto dependency injection par spring du controller dans les tests
	 */&lt;/span&gt;
	@Autowired
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; setClientControllerSpring&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;ClientControllerSpringMVC clientControllerSpring&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;clientControllerSpring&lt;/span&gt; = clientControllerSpring&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	@BeforeClass&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; 	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; testAvantTout&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;	model = &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; ModelMap&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	@AfterClass&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; apresTousLesTests&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;	model.&lt;span style=&quot;color: #006600;&quot;&gt;clear&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	@Before &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; initAvant&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;clientControllerSpring&lt;span style=&quot;color: #66cc66;&quot;&gt;!&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/** testons que spring injection est ok*/&lt;/span&gt;
		logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\t&lt;/span&gt;clientControllerSpring is correctly initialized!&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	@After &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt;  &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; testApres&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	@Test
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; testGetClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;	
		&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//create or get client with given nom. if not exist create it with nom &amp;amp; prenom &lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; str=clientControllerSpring.&lt;span style=&quot;color: #006600;&quot;&gt;getClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;NAME2TEST, LASTNAME2TEST, model&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;Constants.&lt;span style=&quot;color: #006600;&quot;&gt;SUCCESS&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;equals&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;str&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;	logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; model.&lt;span style=&quot;color: #006600;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;client&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;		
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
Les parties importantes pour la compréhension des lanceurs de spring (annotés par @RunWith) sont bien documentées dans le code.
&lt;br /&gt;L'annotation @RunWith définit le lanceur spring qui enrichit considérablement les tests JUnit4 avec les fonctionnalités supplémentaires ( ex. l'auto-injection) offertes par Spring.
&lt;br /&gt;
Spring offre aussi des annotations inexistantes dans JUnit4 utiles à l'exécution de ces tests.
&lt;br /&gt;
Signalons que la ligne:&lt;br /&gt;&lt;/p&gt;
&lt;pre class=&quot;java&quot;&gt;@ContextConfiguration&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;locations=&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;classpath:/config/spring-mvc-webapp-tests.xml&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;classpath:/config/spring-test.xml&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
renvoie à deux fichiers de configuration de springMVC et de spring qui sont donnés en annexe. Ces deux fichiers sont identiques, à une déclaration près, aux fichiers spring-mvc-webapp-servlet.xml et spring.xml explicités auparavant.
La &lt;del&gt;seule différence &lt;/del&gt; est l'ajout de la déclaration de la transaction dans spring-test.xml:&lt;br /&gt;&lt;/p&gt;
&lt;pre class=&quot;xml&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;&amp;lt;!-- transaction --&amp;gt;&lt;/span&gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;bean&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;id&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;transactionManager&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;class&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;org.springframework.jdbc.datasource.DataSourceTransactionManager&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
	 &lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;property&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;name&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;dataSource&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #000066;&quot;&gt;ref&lt;/span&gt;=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;dataSource&amp;quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;lt;/bean&lt;span style=&quot;font-weight: bold; color: black;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
Ainsi, avec le bean &quot;transactionManager&quot; les tests en mode transactionnel ci-après deviennent possibles comme illustré à l'étape suivante.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ETAPE 8.Classe de test en mode transactionnel &lt;/strong&gt;
&lt;br /&gt;
&lt;br /&gt;
Les deux figures suivantes donnent le code de la classe MyServiceTest.java. Cette classe comporte toutes les indications pour excéuter les méthodes en mode transactionnel&amp;nbsp;:
&lt;br /&gt;&lt;/p&gt;
&lt;pre class=&quot;java&quot;&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;package&lt;/span&gt; com.&lt;span style=&quot;color: #006600;&quot;&gt;netapsys&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;tests&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;springmvc&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;web&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;tests&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import java.util.Random;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.apache.log4j.Logger;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.junit.*;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.junit.runner.RunWith;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.beans.factory.annotation.Autowired;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.test.context.ContextConfiguration;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.test.context.transaction.AfterTransaction;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.test.context.transaction.BeforeTransaction;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.test.context.transaction.TransactionConfiguration;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.transaction.annotation.Propagation;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import org.springframework.transaction.annotation.Transactional;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmcv.entites.Client;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmcv.entites.Personne;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmvc.exceptions.MyException;&lt;/span&gt;
&lt;span style=&quot;color: #a1a100;&quot;&gt;import com.netapsys.fr.springmvc.service.MyService;&lt;/span&gt;
&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/** * *******************************************************************
 * NOTE IMPORTANTE: defaultRollback à true ANNULE TOUTES LES ACTIONS DANS LA BASE!
 * ******************************************************************** */&lt;/span&gt;
@ContextConfiguration&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;locations=&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;classpath:/config/spring-mvc-webapp-tests.xml&amp;quot;&lt;/span&gt;,&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;classpath:/config/spring-test.xml&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
@RunWith&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; value=SpringJUnit4ClassRunner.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//indispensable&lt;/span&gt;
@TransactionConfiguration&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;transactionManager=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;transactionManager&amp;quot;&lt;/span&gt;,defaultRollback=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;class&lt;/span&gt; MyServiceTest  &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; Logger logger = Logger.&lt;span style=&quot;color: #006600;&quot;&gt;getLogger&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;getClass&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;getName&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**	 * AUTO INJECTION PAR SPRING    */&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt;  MyService myService&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	@Autowired 	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; setMyService&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;MyService myService&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;this&lt;/span&gt;.&lt;span style=&quot;color: #006600;&quot;&gt;myService&lt;/span&gt; = myService&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	@BeforeClass	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; beforeClasse&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	@Before&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; avantChaqueTest&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;myService==&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; logger.&lt;span style=&quot;color: #006600;&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Y a vraiment un probleme avec spring&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//verifie que l'auto injection de spring est ok&lt;/span&gt;
		logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&amp;gt;&amp;gt;Before test...(this is in transaction scope)&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;	
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	@After&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; apresChaqueTest&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;	logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&amp;gt;&amp;gt;After test...(this is in transaction scope)&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	@BeforeTransaction&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; 
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; avantTransaction&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;	logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&amp;gt;&amp;gt;Avant chaque transaction&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	@AfterTransaction &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; apresTransac&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt; logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&amp;gt;&amp;gt;Apres chaque transaction&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/** *  PREMIER TEST  ****/&lt;/span&gt;
	@Test @Transactional &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;propagation=Propagation.&lt;span style=&quot;color: #006600;&quot;&gt;REQUIRED&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; testCreateClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; nom =giveRandomName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Agent007test&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prenom=giveRandomName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;007test&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		Client client=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;try&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
			client=myService.&lt;span style=&quot;color: #006600;&quot;&gt;getClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;nom,prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;client&lt;span style=&quot;color: #66cc66;&quot;&gt;!&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
				logger.&lt;span style=&quot;color: #006600;&quot;&gt;warn&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;client &amp;quot;&lt;/span&gt;+client +&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot; existe donc ne sera pas créé&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
				&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;throw&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; MyException&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Client existe!&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
			client=myService.&lt;span style=&quot;color: #006600;&quot;&gt;createClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt; nom, prenom&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
			&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;client&lt;span style=&quot;color: #66cc66;&quot;&gt;!&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;gt;&amp;gt;&amp;gt;Client :'&amp;quot;&lt;/span&gt;+client.&lt;span style=&quot;color: #006600;&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;' is created!&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;MyException se&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
			logger.&lt;span style=&quot;color: #006600;&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&amp;gt;&amp;gt;Client exist!&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\t&lt;/span&gt;&amp;quot;&lt;/span&gt;+se.&lt;span style=&quot;color: #006600;&quot;&gt;getMessage&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;/**	 *  2eme test : 	 */&lt;/span&gt;
	@Ignore @Transactional&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;readOnly=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; 
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; testGetClient&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&amp;gt;&amp;gt;&amp;gt;3eme test getClient.&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; NAME=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;nom007nnn&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; LASTNAME=&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;prenom007nnn&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		Personne client=myService.&lt;span style=&quot;color: #006600;&quot;&gt;getClient&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;NAME,LASTNAME&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;client&lt;span style=&quot;color: #66cc66;&quot;&gt;!&lt;/span&gt;=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;null&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;
			logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;quot;&lt;/span&gt;+client.&lt;span style=&quot;color: #006600;&quot;&gt;toString&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; 
			logger.&lt;span style=&quot;color: #006600;&quot;&gt;info&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;Client '&amp;quot;&lt;/span&gt;+NAME+&lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;' not exist!&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; giveRandomName&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;String&lt;/span&gt; prefix&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;final&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;Random&lt;/span&gt; random=&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #aaaadd; font-weight: bold;&quot;&gt;Random&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;		
		&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;return&lt;/span&gt; prefix+random.&lt;span style=&quot;color: #006600;&quot;&gt;nextInt&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #cc66cc;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br /&gt;
Pour tester ces différentes classes, lancer la commande &quot;mvn test&quot;. &lt;br /&gt;
Les commentaires du code et les traces de log4j à  retrouver après l'exécution sont très explicites.
Ils permettent de voir qu'en positionnant le &quot;defaultRollback&quot; de l'annotation spring &quot;@TransactionConfiguration&quot; à true, ces tests simulent la création d'un client dans la base.
&lt;br /&gt;
C'est à dire, qu'un rollback est fait à chaque test. On peut modifier le paramètre &quot;defaultRollback=false&quot;, et les transactions insèrent bien des clients dans la base.
&lt;br /&gt;
Mais généralement, en mode test, le defaultRollback est positionné à true.
&lt;br /&gt;
L'annotation de Spring @Autowired gère fort bien l'auto-injection si on observe la règle suivante&amp;nbsp;: Annoter, avec les @Autowired, toujours les méthodes setters/getters et positionner dans les fichiers de configuration de spring le defaut-autowired à byName afin d'anticiper sur des exceptions indéchiffrables.
&lt;br /&gt;
C'est là que l'on prend conscience de l'apport de Spring au framework de test JUnit. Juste  quelques annotations en plus et les tests deviennent transactionnels.
&lt;br /&gt;
Les retours bénéfiques de ces tests sont considérables.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ETAPE 9. Conclusion &lt;/strong&gt;
&lt;br /&gt;
&lt;br /&gt;
Combiner Spring 2.5+ et JUnit4 permet d'avoir sous la main un framework de test puissant facilitant la mise en place des tests unitaires et d'intégration. Bien que l'apprentissage exige un léger effort, une fois ces deux frameworks maîtrisés, l'efficacité et le gain économique sont énormes.&lt;br /&gt;
Enfin, la qualité du livrable au client ne sera que meilleure.
&lt;br /&gt;
Observons, en particulier, dans les classes de tests en mode transactionnel, le confort qu'apporte Spring à JUnit4.&lt;br /&gt;
Les annotations Spring @TransactionConfiguration et @Transactional rendent les transactions à la portée de tout le monde.
&lt;br /&gt;
Dans un prochain billet, je reviendrai sur les tests paramétrés dans Spring.
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;ETAPE 10. Annexes (pom et codes sources) &lt;/strong&gt;
&lt;br /&gt;&lt;br /&gt;
La figure ci-après illustre l'arborescence du projet&lt;br /&gt; &lt;img src=&quot;http://blog.netapsys.fr/public/code/JUnit4EtSpringMVC/Arborescence_projet.PNG&quot; alt=&quot;arbo_projetJunit4SpringMVC&quot; /&gt;.
&lt;br /&gt;
&lt;br /&gt;
Le fichier zip contenant le projet ainsi que les détails du pom.xml sont joints à ce billet.
&lt;br /&gt;&lt;/p&gt;</description>
    
          <enclosure url="http://blog.netapsys.fr/public/code/JUnit4EtSpringMVC/spring-mvc-webapp_blog220309.zip"
      length="117475" type="application/zip" />
    
    
          <comments>http://blog.netapsys.fr/index.php/post/2009/01/08/Tests-Unitaires-et-dintegration-avec-Junit4-et-Spring-MVC-en-mode-transactionnel#comment-form</comments>
      <wfw:comment>http://blog.netapsys.fr/index.php/post/2009/01/08/Tests-Unitaires-et-dintegration-avec-Junit4-et-Spring-MVC-en-mode-transactionnel#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.netapsys.fr/index.php/feed/rss2/comments/58</wfw:commentRss>
      </item>
    
  <item>
    <title>[Retour sur la conférence] Java / .NET : Qui dominera le marché dans 10 ans ?</title>
    <link>http://blog.netapsys.fr/index.php/post/2009/01/27/%5BRetour-sur-la-conference%5D-Java-/-NET-%3A-Qui-dominera-le-marche-dans-10-ans</link>
    <guid isPermaLink="false">urn:md5:754c263debc26b835814f2e5e153c419</guid>
    <pubDate>Fri, 20 Mar 2009 12:46:00 +0100</pubDate>
    <dc:creator>Sébastien Hébert</dc:creator>
        <category>.NET</category>
        <category>.NET</category><category>java</category><category>Metro</category><category>netapsys</category><category>open source</category><category>WCF</category>    
    <description>&lt;p&gt;Le 22 janvier dernier s'est déroulée une conférence sur le thème Java VS .NET. Plusieurs intervenants étaient présents dont SODIFRANCE, ACCENTURE et bien entendu NETAPSYS.&lt;/p&gt;


&lt;p&gt;Petit retour sur la soirée&amp;nbsp;!&lt;/p&gt;    &lt;p&gt;Une chose est sûre&amp;nbsp;: en France et globalement en Europe, Java est bien plus présent que .NET technologiquement parlant. S'il est vrai que .NET  grignote petit à petit des parts de marché à Java, personne ne peut répondre avec certitude à cette question.&lt;/p&gt;


&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h2&gt;SODIFRANCE prévoit la disparition du développeur.&lt;/h2&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;SODIFRANCE prétend que le métier de développeur est amené tôt ou tard à disparaitre d'une certaine manière compte-tenu de la percée de l'approche MDA (Model Driven Architecture) où le principe consiste à générer le code à partir de la modélisation UML du modèle, De plus, les intervenants considèrent que parler de Java et de .NET uniquement n'est pas représentatif du marché puisqu'à juste titre beaucoup d'applications tourneront encore sur COBOL, et ce peut-être même dans 10 ans.&lt;/p&gt;


&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h2&gt;ACCENTURE mise sur une démarche SOA.&lt;/h2&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;Même si ACCENTURE ne prétend pas pouvoir non plus répondre à la question du &quot;Qui gagnera ?&quot;, les intervenants ne cachent pas cependant leur préférence qui va directement à Java / JavaEE. Cette préférence s'explique par le fait que Java soit davantage tourné vers l'Open Source et les standards contrairement à .NET jugé trop enfermé dans la sphère Microsoft. De plus, de nombreux éditeurs comme SAP ou Oracle ont choisi de faire tourner leurs solutions logicielles sur des socles Java (Oracle ESB pour Oracle et Netweaver pour SAP). ACCENTURE estime que les technologies gagnantes de demain seront celles qui répondront au mieux à la problématique posée par la démarche SOA&amp;nbsp;: &quot;comment concevoir de nouvelles applications qui s'intègrent dans une stratégie de rationalisation du SI en évitant le plus possible l'effet &lt;strong&gt;SILO Applicatif&lt;/strong&gt; ?&quot;&lt;/p&gt;


&lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h2&gt;NETAPSYS thinks Java &amp;amp;&amp;amp; .NET&lt;/h2&gt;

&lt;p&gt;&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;NETAPSYS a, quant à elle, adopté une approche plus technique et finalement les trois présentations ont été assez complémentaires. Après quelques rappels sur l'historique de Java et de .NET, je me suis penché sur les raisons légitimes qui poussent les développeurs à opposer Java et .NET. Le premier bilan est que la technologie importe peu dans le sens où l'une et l'autre permettent d'arriver au même résultat.&lt;/p&gt;


&lt;p&gt;Toutefois, il semblerait que les développeurs préfèrent Java à .NET pour le développement côté serveur étant donné la pérennité de la technologie par rapport à .NET et l'existence de nombreux frameworks qui ont su s'imposer dans l'Entreprise. Il n'y a qu'à voir Struts, Spring, JSF ou encore Hibernate pour la persistance.&lt;/p&gt;


&lt;p&gt;A contrario, il semblerait que .NET soit la référence quant au développement d'applications visuellement riches. Microsoft investit en effet énormément sur les IHM (Windows Forms, WPF, Silverlight).&lt;/p&gt;


&lt;p&gt;La présentation s'est terminée sur le fait qu'il ne fallait pas nécessairement penser Java ou .NET mais peut-être les deux !!! Microsoft et Sun travaillent en effet depuis quelques temps sur la manière d'améliorer l'interopérabilité entre les deux mondes, même si et on s'en doute, la volonté de chacun est d'attirer le plus de développeurs de son côté.&lt;/p&gt;


&lt;p&gt;Microsoft, via Windows Azure, et sa future plateforme de Cloud Computing, flirte du côté de Java en proposant une API pour Azure. De la même manière, l'éditeur a annoncé un plugin pour Eclipse concernant le développement d'applications Silverlight.&lt;/p&gt;


&lt;p&gt;De son côté, Sun a instauré la pile de Services Web Metro intéropérable avec WCF - Windows Communication Fourndation - disponible depuis .NET 3.&lt;/p&gt;


&lt;p&gt;Voilà, c'est tout pour le moment. Si le sujet intéresse du monde, je vous propose, comme Marine me l'a suggéré, de vous refaire la présentation afin de bénéficier de vos retours et peut-être de lancer un grand débat&amp;nbsp;!&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.netapsys.fr/index.php/post/2009/01/27/%5BRetour-sur-la-conference%5D-Java-/-NET-%3A-Qui-dominera-le-marche-dans-10-ans#comment-form</comments>
      <wfw:comment>http://blog.netapsys.fr/index.php/post/2009/01/27/%5BRetour-sur-la-conference%5D-Java-/-NET-%3A-Qui-dominera-le-marche-dans-10-ans#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.netapsys.fr/index.php/feed/rss2/comments/67</wfw:commentRss>
      </item>
    
  <item>
    <title>La nouvelle version du site www.netapsys.fr est en ligne !</title>
    <link>http://blog.netapsys.fr/index.php/post/2009/03/13/La-nouvelle-version-du-site-wwwnetapsysfr-est-en-ligne</link>
    <guid isPermaLink="false">urn:md5:b291606af25b92185b3ba6e3873e5ad4</guid>
    <pubDate>Fri, 13 Mar 2009 15:00:00 +0100</pubDate>
    <dc:creator>Bénédicte Guignard</dc:creator>
        <category>Netapsys</category>
        <category>netapsys</category><category>opencms</category><category>php</category><category>spip</category>    
    <description>&lt;p&gt;La nouvelle version du site Internet de Netapsys a été mise en ligne le 11 mars 2009. Ce sont les équipes Netapsys qui accueillent, dès la première page, les visiteurs du site.&lt;/p&gt;    &lt;p&gt;Le premier site Internet de Netapsys a été mis en place en 2004, à la création de la société. Cette première version était statique. Après une seconde version sous OpenCMS, réalisée en 2006, le contenu et l’ergonomie du site avaient de nouveau besoin d’être actualisés.&lt;/p&gt;


&lt;p&gt;C’est la plateforme de contenu SPIP qui a été retenue pour le développement du nouveau site. Le développement, en PHP, a été confié à Denis, ingénieur Netapsys de l’agence de Nantes.
SPIP (Système de Publication pour l'Internet Partagé) est un logiciel libre destiné à la production de sites Web, de type CMS.
SPIP possède une communauté active sur le net et on trouve de la documentation assez facilement. Pour en savoir plus, vous pouvez visiter &lt;a href=&quot;http://www.spip-contrib.net&quot; hreflang=&quot;fr&quot;&gt;http://www.spip-contrib.net&lt;/a&gt;. L’outil SPIP, grâce à son interface très simple d’utilisation, permet d’administrer le site de manière dynamique et de le tenir facilement à jour. Pour preuve, j’ai moi-même rédigé et mis en ligne les articles&amp;nbsp;! :-)
La réalisation et la mise en ligne du site illustre la parfaite collaboration entre les équipes Netapsys de Paris et de Nantes.&lt;/p&gt;


&lt;p&gt;Sur notre nouveau site Internet vous trouverez toutes les informations concernant Netapsys (la société, ses chiffres clés, son savoir-faire, sa culture, ses projets…) et ses actualités (ses dernières références, sa newsletter, ses offres d’emploi…). Le tout est mis en graphisme par le studio Beeart. Et, pour illustrer ce nouveau site, Netapsys a préféré, aux classiques banques d’images, des photographies de ses collaborateurs (crédits photos&amp;nbsp;: Maria Mikulas). Ils sont ses meilleurs ambassadeurs&amp;nbsp;!&lt;/p&gt;


&lt;p&gt;Bonne visite sur &lt;a href=&quot;http://www.netapsys.fr/&quot; hreflang=&quot;fr&quot;&gt;www.netapsys.fr&lt;/a&gt;&amp;nbsp;!&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.netapsys.fr/index.php/post/2009/03/13/La-nouvelle-version-du-site-wwwnetapsysfr-est-en-ligne#comment-form</comments>
      <wfw:comment>http://blog.netapsys.fr/index.php/post/2009/03/13/La-nouvelle-version-du-site-wwwnetapsysfr-est-en-ligne#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.netapsys.fr/index.php/feed/rss2/comments/78</wfw:commentRss>
      </item>
    
  <item>
    <title>L’entretien annuel chez Netapsys</title>
    <link>http://blog.netapsys.fr/index.php/post/2009/01/26/Lentretien-annuel-chez-Netapsys</link>
    <guid isPermaLink="false">urn:md5:1ccacbb5e2c40c31f56ee1f6069daaf9</guid>
    <pubDate>Mon, 26 Jan 2009 09:47:00 +0100</pubDate>
    <dc:creator>Marine Hamon</dc:creator>
        <category>Netapsys</category>
        <category>carrière</category><category>entretien annuel</category><category>netapsys</category><category>resources humaines</category><category>évolution</category>    
    <description>    &lt;p&gt;Chez Netapsys, nous partons du principe que c’est avant tout par envie que l’on réussit. Chacun est acteur de son évolution et construit son poste en fonction de ses motivations. L’entretien annuel permet d’avoir un échange privilégié avec son manager, la responsable RH et la direction.&lt;/p&gt;


&lt;p&gt;Il  se déroule en trois temps&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;-	Un premier entretien avec son chef de projet et la responsable RH. A cette occasion, nous faisons  un bilan de l’année précédente en commençant par évaluer  les compétences. Les  critères sont définis au préalable afin de garantir l’objectivité des évaluations. Dès cette étape, le collaborateur est impliqué&amp;nbsp;: il prépare une auto-évaluation ce qui lui permet de prendre du recul, d’identifier les forces sur lesquelles s’appuyer ainsi que les axes à améliorer. C’est en affinant ses auto-évaluations et en se corrigeant  naturellement que l’on progresse le plus vite&amp;nbsp;! Par la suite, l'échange se poursuit à partir de l'évaluation du manager et de la responsable RH qui apportent leur regard extérieur et exposent leurs évaluations à partir d’éléments factuels. Nous évaluons également l’atteinte des objectifs et calculons le montant du variable sur objectif qui sera versé fin janvier.&lt;/p&gt;


&lt;p&gt;-	En deuxième partie de ces entretiens, nous abordons les éléments de motivation du collaborateur et définissons une projection. Cela permet de donner de la visibilité sur l’évolution de carrière, d’identifier la cible à un an et de décliner les objectifs pour l’année à venir.  Le cadre fixé est volontairement souple afin de permettre à chacun d’apporter, durant toute l’année, sa valeur ajoutée sur les sujets qui l’intéressent le plus et ainsi de contribuer à la construction d’une entreprise qui favorise l’émergence d’idées nouvelles.&lt;/p&gt;


&lt;p&gt;-	Suite à ce premier entretien, un deuxième entretien est fixé avec Yoann Hébert afin d’entériner les orientations pour l’année à venir, de répondre aux éventuelles questions des collaborateurs et de pouvoir échanger sur la stratégie et l’évolution de Netapsys.&lt;/p&gt;


&lt;p&gt;Netapsys est une entreprise en évolution permanente. Chacun grandit avec l’entreprise qui elle-même se construit grâce à l’apport de chaque Netapsyen.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.netapsys.fr/index.php/post/2009/01/26/Lentretien-annuel-chez-Netapsys#comment-form</comments>
      <wfw:comment>http://blog.netapsys.fr/index.php/post/2009/01/26/Lentretien-annuel-chez-Netapsys#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.netapsys.fr/index.php/feed/rss2/comments/66</wfw:commentRss>
      </item>
    
  <item>
    <title>Petits Déjeuners Netapsys / Intégration continue et outils de pilotage stratégique de vos projets</title>
    <link>http://blog.netapsys.fr/index.php/post/2008/10/10/Evenements-/-Petits-Dejeuners-NETAPSYS-/-Integration-continue-%3A-Outil-de-conduite-de-changement</link>
    <guid isPermaLink="false">urn:md5:585199befa5c57204c002492c888998b</guid>
    <pubDate>Fri, 10 Oct 2008 16:22:00 +0200</pubDate>
    <dc:creator>Sébastien Roul</dc:creator>
        <category>Netapsys</category>
        <category>hudson</category><category>industrialisation</category><category>intégration continue</category><category>maven</category><category>netapsys</category><category>petit déjeuner</category><category>pilotage</category><category>qualité</category><category>sonar</category>    
    <description>    &lt;p&gt;&lt;strong&gt;Jeudi 20 novembre à Nantes, Netapsys Atlantique vous invite à son petit déjeuner technique&amp;nbsp;: Intégration continue et outils de pilotage stratégique de vos projets.&lt;/strong&gt;&lt;/p&gt;


&lt;p&gt;Animée par Jean-Baptiste Defard, Directeur Technique Netapsys, cette présentation sera l'occasion de détailler l'apport de tels outils par rapport à vos problématiques d'industrialisation des développements, de qualité et de pilotage stratégique de vos projets.&lt;/p&gt;


&lt;p&gt;Nous vous proposerons sur cette rencontre de répondre aux questions suivantes&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Qu'est-ce que l'intégration continue&amp;nbsp;?&lt;/li&gt;
&lt;li&gt;Quelles sont les étapes importantes de sa mise en oeuvre&amp;nbsp;?&lt;/li&gt;
&lt;li&gt;Quels sont les impacts au quotidien&amp;nbsp;?&lt;/li&gt;
&lt;li&gt;Quels sont les outils disponibles&amp;nbsp;? Maven, Hudson, Sonar...&lt;/li&gt;
&lt;li&gt;Quels retours d'expérience après plus d'un an d'utilisation&amp;nbsp;?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Inscription sur notre site&amp;nbsp;: &lt;a href=&quot;http://petitdejeuner.netapsys.fr&quot; hreflang=&quot;fr&quot;&gt;http://petitdejeuner.netapsys.fr&lt;/a&gt;&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.netapsys.fr/index.php/post/2008/10/10/Evenements-/-Petits-Dejeuners-NETAPSYS-/-Integration-continue-%3A-Outil-de-conduite-de-changement#comment-form</comments>
      <wfw:comment>http://blog.netapsys.fr/index.php/post/2008/10/10/Evenements-/-Petits-Dejeuners-NETAPSYS-/-Integration-continue-%3A-Outil-de-conduite-de-changement#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.netapsys.fr/index.php/feed/rss2/comments/44</wfw:commentRss>
      </item>
    
  <item>
    <title>Séminaire Netapsys, un concept innovant de piraterie informatique…</title>
    <link>http://blog.netapsys.fr/index.php/post/2008/09/26/Seminaire-Netapsys-un-concept-innovant-de-piraterie-informatique</link>
    <guid isPermaLink="false">urn:md5:1b63cecd34e1d08b05f32abd35e81147</guid>
    <pubDate>Fri, 26 Sep 2008 17:54:00 +0200</pubDate>
    <dc:creator>Marine Hamon</dc:creator>
        <category>Netapsys</category>
        <category>netapsys</category><category>séminaire</category>    
    <description>&lt;p&gt;Les 12 et 13 septembre, l’équipe Netapsys s’est réunie à Nantes afin de permettre aux collaborateurs parisiens de découvrir notre nouvelle agence, d’échanger sur les pratiques mais surtout de partager ensemble des moments de détente et de convivialité.&lt;/p&gt;    &lt;p&gt;Après une visite des locaux, les collaborateurs soucieux de challenger l’animateur de la réunion prévue dans l’après-midi, ont fait honneur au déjeuner&amp;nbsp;! Par bonheur, Sébastien Roul avait concocté une séance de travail dynamique en s’appuyant sur des méthodes plus fréquemment utilisées en improvisation théâtrale qu’en entreprise. Et le résultat est là&amp;nbsp;: 30 idées à la fois concrètes et créatives ont été proposées par les équipes&amp;nbsp;!&lt;/p&gt;


&lt;p&gt;Pour terminer la journée, les collaborateurs se sont retrouvés autour d’une table mais cette fois-ci pour un tournoi de poker. Nos nouvelles recrues, Pierre-Yves, Marc-Olivier et Florence, ont révélé des talents jusqu’alors cachés.&lt;/p&gt;


&lt;p&gt;Quant au samedi, Bénédicte est parvenue à préserver la surprise jusqu’au bout malgré les pièges tendus par les plus curieux. C’est à bord de voiliers que les équipages ont découvert les berges de l’Erdre. Et là, point de piratage informatique… juste de la piraterie&amp;nbsp;!&lt;/p&gt;



&lt;p&gt;&lt;img src=&quot;http://blog.netapsys.fr/public/images/Séminaire Nantes/.IMG_8464_m.jpg&quot; alt=&quot;Equipe&quot; style=&quot;display:block; margin:0 auto;&quot; /&gt;&lt;br /&gt;
&lt;img src=&quot;http://blog.netapsys.fr/public/images/Séminaire Nantes/.P1000435_s.jpg&quot; alt=&quot;Idées les vraies&quot; style=&quot;float:left; margin: 0 1em 1em 0;&quot; /&gt;&lt;br /&gt;
&lt;img src=&quot;http://blog.netapsys.fr/public/images/Séminaire Nantes/.IMG_8581_s.jpg&quot; alt=&quot;Idées Python&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;&lt;br /&gt;
&lt;img src=&quot;http://blog.netapsys.fr/public/images/Séminaire Nantes/.IMG_8687_s.jpg&quot; alt=&quot;bateau 1&quot; style=&quot;float:left; margin: 0 1em 1em 0;&quot; /&gt;&lt;br /&gt;
&lt;img src=&quot;http://blog.netapsys.fr/public/images/Séminaire Nantes/.IMG_8608_s.jpg&quot; alt=&quot;Joan et Francois&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;




&lt;p&gt;Photos de Darko Stankovski, Marc-Olivier Croix, Sébastien Hébert et Vincent Durand.
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;Un grand merci à toute l’équipe grâce à qui l’aventure Netapsys est possible et tout particulièrement à Yoann, Jérémy, Sébastien et Bénédicte pour l’organisation de ces deux journées.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.netapsys.fr/index.php/post/2008/09/26/Seminaire-Netapsys-un-concept-innovant-de-piraterie-informatique#comment-form</comments>
      <wfw:comment>http://blog.netapsys.fr/index.php/post/2008/09/26/Seminaire-Netapsys-un-concept-innovant-de-piraterie-informatique#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.netapsys.fr/index.php/feed/rss2/comments/43</wfw:commentRss>
      </item>
    
  <item>
    <title>Netapsys sur le JDN Développeurs - Intéropérabilité entre Java et .NET : rêve ou réalité ?</title>
    <link>http://blog.netapsys.fr/index.php/post/2008/09/01/Netapsys-sur-le-JDN-Developpeurs-Interoperabilite-Java-/-NET-%3A-reve-ou-realite</link>
    <guid isPermaLink="false">urn:md5:972fed83f939f5215b1ca2a0baf706a7</guid>
    <pubDate>Mon, 01 Sep 2008 11:39:00 +0200</pubDate>
    <dc:creator>Sébastien Hébert</dc:creator>
        <category>.NET</category>
        <category>.NET</category><category>glassfish</category><category>interopérabilité</category><category>java</category><category>metro</category><category>netapsys</category><category>WCF</category>    
    <description>    &lt;p&gt;Netapsys publie un &lt;a href=&quot;http://www.journaldunet.com/developpeur/expert/30084/interoperabilite-java----net---reve-ou-realite.shtml&quot; hreflang=&quot;fr&quot;&gt;nouvel article sur le Journal du Net&lt;/a&gt; dressant une synthèse sur l'interopérabilité entre Java et .NET via les Services Web.&lt;/p&gt;


&lt;p&gt;Si le sujet n'est pas nouveau en soi, quelques progrès sont à noter à savoir une meilleure prise en charge de la sécurité (authentification par certificat, etc.) et de la gestion transactionnelle. Les outils/technos dont il est question sont WCF 3.0 (Windows Communication Foundation apparu avec .NET 3.0) et Metro (piles de services Web) disponible dans Glassfish et utilisable sous Tomcat (implémentation à base de servlet disponible uniquement).&lt;/p&gt;


&lt;p&gt;PS&amp;nbsp;: Un grand merci à Yoann, Jérémy et Jean-Baptiste pour leurs retours.&lt;/p&gt;</description>
    
    
    
          <comments>http://blog.netapsys.fr/index.php/post/2008/09/01/Netapsys-sur-le-JDN-Developpeurs-Interoperabilite-Java-/-NET-%3A-reve-ou-realite#comment-form</comments>
      <wfw:comment>http://blog.netapsys.fr/index.php/post/2008/09/01/Netapsys-sur-le-JDN-Developpeurs-Interoperabilite-Java-/-NET-%3A-reve-ou-realite#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.netapsys.fr/index.php/feed/rss2/comments/38</wfw:commentRss>
      </item>
    
  <item>
    <title>Karting : championnat Netapsys / INDOM à Magny-cours</title>
    <link>http://blog.netapsys.fr/index.php/post/2008/04/22/Karting-%3A-championnat-Netapsys-/-INDOM-a-Magny-cours</link>
    <guid isPermaLink="false">urn:md5:008a137082e940e52da855c876d79ec6</guid>
    <pubDate>Tue, 22 Apr 2008 13:39:00 +0200</pubDate>
    <dc:creator>Yoann Hébert</dc:creator>
        <category>Netapsys</category>
        <category>karting</category><category>magny-cours</category><category>netapsys</category>    
    <description>&lt;p&gt;Les as du volant ont encore frappé&amp;nbsp;! Ce n'est pas la première fois que l'équipe Netapsys se retrouve sur une piste de kart mais ce samedi 19 avril restera particulièrement mémorable.
Il s'agissait tout simplement du premier championnat de karting Netapsys / INDOM sur le circuit mythique de Magny-Cours. Après une épreuve de qualification, qui a eu lieu à Paris et qui a permis de sélectionner les 5 meilleurs de chaque société, les deux équipes se sont retrouvées à Magny-Cours pour une journée bien remplie&amp;nbsp;: visite d'une école de  F1, accès aux stands du championnat Peugeot Sport, séance de karting sur le circuit dédié de Magny-cours...&lt;/p&gt;


&lt;p&gt;&lt;a href=&quot;http://blog.netapsys.fr/public/doc/20080419-karting.pdf&quot; hreflang=&quot;fr&quot;&gt;Ci-joint&lt;/a&gt; le récit de cette journée par Stéphane Van Gelder, Directeur Général INDOM.&lt;/p&gt;    &lt;p&gt;&lt;br /&gt;&lt;/p&gt;

&lt;h2&gt;Opération Karting&amp;nbsp;: Fair-play et parfaite égalité&lt;/h2&gt;

&lt;p&gt;&lt;br /&gt;
Le 19 avril dernier, deux équipes avaient rendez-vous sur la piste karting du complexe automobile de Magny-Cours. D'un côté, les 5 qualifiés INDOM. De l'autre, le même nombre de pilotes pour représenter Netapsys. Tout ce petit monde arrive dès le matin sur la piste principale, celle du Grand Prix de F1. Certains sont visiblement déjà très chauds, au point de devoir abandonner quelques points sur leur permis avant même d'arriver au circuit…&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;Puisqu'il est question de F1, la journée commence par une visite guidée des ateliers LRS, spécialisée dans les stages de pilotage sur F1.&lt;br /&gt;
&lt;img src=&quot;http://blog.netapsys.fr/public/images/LRS.jpg&quot; alt=&quot;Atelier F1 LRS&quot; /&gt;&lt;br /&gt;
Le guide&amp;nbsp;: Mathieu Zangarelli, l'un des meilleurs pilotes français. Dans les grands ateliers, on découvre les nombreuses F1 exploitées par LRS. On regarde, on touche, on prend même place à bord pour un voyage inoubliable dans les hautes sphères du sport automobile.&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;Mais déjà la tension monte. C'est l'heure de la course.
&lt;img src=&quot;http://blog.netapsys.fr/public/images/karting1.jpg&quot; alt=&quot;Karting Netapsys INDOM&quot; /&gt;&lt;br /&gt;
Une première séance d'essais libres permet à NETAPSYS de renforcer ses rangs, Yoann ne résistant
pas à l'appel de la piste. INDOM domine néanmoins les essais puisque Patrick s'impose devant Vincent, Yoann et Nicolas. La tendance s'inverse en pré-finale,
Vincent gagne cette course de 10 tours devant Patrick, Yoann et Mickael. Pour la grande finale de 15 tours, les plus rapides partent du fond de la grille. Patrick parvient néanmoins à s'extraire de la meute et va s'imposer. Suivent Yoann et Nicolas sur le podium final, puis Mickael, Vincent, Joachim, Romuald, Julie, Jeremy, Kefah et Brahim.&lt;br /&gt;&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://blog.netapsys.fr/public/images/karting2.jpg&quot; alt=&quot;Karting Netapsys INDOM&quot; /&gt;&lt;br /&gt;
Au moment d'additionner les points, on ne pouvait rêver meilleur résultat puisque c'est l'équilibre parfait&amp;nbsp;: chaque équipe marque 39 points… et tout le monde monte sur le podium&amp;nbsp;!&lt;/p&gt;</description>
    
          <enclosure url="http://blog.netapsys.fr/public/doc/20080419-karting.pdf"
      length="797467" type="application/pdf" />
    
    
          <comments>http://blog.netapsys.fr/index.php/post/2008/04/22/Karting-%3A-championnat-Netapsys-/-INDOM-a-Magny-cours#comment-form</comments>
      <wfw:comment>http://blog.netapsys.fr/index.php/post/2008/04/22/Karting-%3A-championnat-Netapsys-/-INDOM-a-Magny-cours#comment-form</wfw:comment>
      <wfw:commentRss>http://blog.netapsys.fr/index.php/feed/rss2/comments/16</wfw:commentRss>
      </item>
    
</channel>
</rss>