IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Struts 2 Java Discussion :

Introduction à Struts 2 par l'exemple, par Serge Tahé


Sujet :

Struts 2 Java

  1. #1
    Rédacteur

    Avatar de Mickael Baron
    Homme Profil pro
    Ingénieur de Recherche en Informatique
    Inscrit en
    Juillet 2005
    Messages
    14 974
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Vienne (Poitou Charente)

    Informations professionnelles :
    Activité : Ingénieur de Recherche en Informatique
    Secteur : Service public

    Informations forums :
    Inscription : Juillet 2005
    Messages : 14 974
    Points : 73 024
    Points
    73 024
    Par défaut Introduction à Struts 2 par l'exemple, par Serge Tahé
    Bonjour

    Serge Tahé propose un article pour découvrir Struts 2 le successeur de Struts. Struts 2 est un projet de l'Apache Software Foundation (www.apache.org) qui a pour but de fournir un cadre standard de développement d'applications web en Java respectant l'architecture dite MVC (Modèle – Vue – Contrôleur).

    Serge Tahé se propose, dans ce document, d'illustrer les concepts importants de Struts 2 par des exemples.

    Vous trouverez l'article à l'adresse suivante : http://tahe.developpez.com/java/struts2/

    Mickael
    Responsable Java de Developpez.com (Twitter et Facebook)
    Besoin d"un article/tutoriel/cours sur Java, consulter la page cours
    N'hésitez pas à consulter la FAQ Java et à poser vos questions sur les forums d'entraide Java
    --------
    Ingénieur de Recherche en informatique au LIAS / ISAE-ENSMA
    Page de Developpez.com : mbaron.developpez.com
    Twitter : www.twitter.com/mickaelbaron
    Blog : mickael-baron.fr
    LinkedIn : www.linkedin.com/in/mickaelbaron
    DBLP : dblp.uni-trier.de/pers/hd/b/Baron:Micka=euml=l

  2. #2
    Membre actif Avatar de Lician
    Homme Profil pro
    Architecte Logiciel
    Inscrit en
    Mars 2011
    Messages
    93
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France, Yvelines (Île de France)

    Informations professionnelles :
    Activité : Architecte Logiciel
    Secteur : Services de proximité

    Informations forums :
    Inscription : Mars 2011
    Messages : 93
    Points : 230
    Points
    230
    Par défaut Longue vie au tuto!
    Très bon tuto!
    Il est bien détaillé et présente plusieurs problématiques.

    J'approuve fortement!

    Même si c'est présenté sous Netbeans!
    Je blague bien sûr! J'ai juste une préférence pour Eclipse!

    Bravo à Serge!


    Cordialement
    Keep enjoy'n the ride and let's rock...
    Pensez au bouton et à voter sur les messages utiles pour les autres!
    --------
    Lician - https://chat.developpez.com/ - http://87.98.168.209/

  3. #3
    Membre confirmé
    Avatar de Khaled.Noordin
    Homme Profil pro
    Inscrit en
    Janvier 2005
    Messages
    354
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 354
    Points : 497
    Points
    497
    Billets dans le blog
    1
    Par défaut
    Super initiative de la part de serge, je regrette juste qu'il n'y ait pas une plus grande utilisation d’élément standard au développement logiciel à savoir ne pas avoir introduit maven qui ne nécessitait aucune installation puisque livré en embarqué dans l'IDE qui aurait permis une approche multi-ide au tutoriel ainsi de démarrer sur le même projet vierge("blank") puisque existant dans les archetypes de l'ide
    ensuite de ne pas avoir utilisé jpa avec une base de données embarqué en mémoire type h2, cela aurait soulagé le nom initié à mysql.
    Pour le reste félicitation pour cette ouverture au savoir de manière bénévole.
    Un grand merci à toi Serge

  4. #4
    Membre régulier Avatar de med_alpa
    Inscrit en
    Juillet 2005
    Messages
    134
    Détails du profil
    Informations forums :
    Inscription : Juillet 2005
    Messages : 134
    Points : 87
    Points
    87
    Par défaut
    Bonjour,

    Très bon tuto, mais j'aurais aimer qu'il soit avec Eclipse .
    "Je n'ai pas de talents particuliers. Je suis juste passionnément curieux." Albert Einstein

  5. #5
    Membre habitué Avatar de Altenide
    Homme Profil pro
    Formateur en technologies web
    Inscrit en
    Décembre 2008
    Messages
    129
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Formateur en technologies web
    Secteur : Enseignement

    Informations forums :
    Inscription : Décembre 2008
    Messages : 129
    Points : 182
    Points
    182
    Par défaut
    très bon tuto éffectivement, j'en ai fait un (il date un peu 2 ans) de moins bonne qualité certes mais pour éclipse at : http://www.olivier-guillou.fr/oneand...-avec-struts-2

  6. #6
    Nouveau membre du Club
    Inscrit en
    Juin 2010
    Messages
    47
    Détails du profil
    Informations forums :
    Inscription : Juin 2010
    Messages : 47
    Points : 39
    Points
    39
    Par défaut Probleme d'execution de pam-01
    Bonjour à tous
    J'ai suivi avec beaucoup d'interet cet excellent tuto. J'apprecie beaucoup l'esprit du detail. Seulement j'ai eu un probleme pour excecuter le projet pam-01. Voilà le message d'erreur que j'obtiens:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    13 mai 2012 15:01:39 org.apache.catalina.core.ApplicationContext log
    INFO: Closing Spring root WebApplicationContext
    13 mai 2012 15:08:19 org.apache.catalina.core.ApplicationContext log
    INFO: Initializing Spring root WebApplicationContext
    13 mai 2012 15:08:19 org.apache.catalina.core.StandardContext listenerStart
    GRAVE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 8 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
    	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
    	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
    	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
    	at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
    	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    	at java.lang.Thread.run(Thread.java:619)
    Caused by: org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
    	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    	at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
    	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    	at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
    	at org.apache.xerces.impl.XMLScanner.scanPIData(Unknown Source)
    	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanPIData(Unknown Source)
    	at org.apache.xerces.impl.XMLScanner.scanPI(Unknown Source)
    	at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
    	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
    	... 21 more
    13 mai 2012 15:08:19 org.apache.catalina.core.ApplicationContext log
    INFO: Closing Spring root WebApplicationContext
    Je ne sais pas s'il me manque des archives ? J'ai essayé d'ajouter quelques librairies:Spring Web MVC 3.0.6 RELEASE, Spring framework 3.0.6 RELEASE.
    J'ai pensé aussi qu'il pourrait s'agir d'un problème de version.
    J'utilise NetBeans IDE 7.1.1 et Tomcat-7.

    Grand merci à Serge.
    Coulane

  7. #7
    Membre régulier
    Profil pro
    Développeur informatique
    Inscrit en
    Mai 2006
    Messages
    52
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique

    Informations forums :
    Inscription : Mai 2006
    Messages : 52
    Points : 77
    Points
    77
    Par défaut petit ajout
    Bonjour,

    Très bon tuto comme d'habitude !

    Je suis a l'exemple 8 au niveau du formulaire. Netbeans 7.2 affiche trois petite erreur de syntaxe sur les lignes 29, 32, et 35 qui n’empêche pas l'exécution de l'exemple.

    Après recherche, Netbeans utilise JSP EL 2.1 pour la vérification syntaxique et affiche donc l'erreur : Encountered ":" at line X, column Y. Was expecting one of...."

    Pour supprimer cette erreur, il suffit de déclarer les balises comme ceci:

    Exemple pour la ligne 29:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <s:select name="select3" list="#@java.util.Map@{'01':'vert(01)','02':'jaune(02)','03':'rouge(03)','04':'blanc(04)','05':'noir(05)'}" size="3" key="Form.select3" multiple="true"/>

  8. #8
    Expert éminent

    Profil pro
    Inscrit en
    Avril 2009
    Messages
    131
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2009
    Messages : 131
    Points : 6 550
    Points
    6 550
    Par défaut
    Bonjour,

    J'ai essayé la solution précédente mais elle ne marche pas. Map est une interface. Je pense qu'il veut une classe. J'ai écrit :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <s:select name="select3" list="#@java.util.HashMap@{'01':'vert(01)','02':'jaune(02)','03':'rouge(03)','04':'blanc(04)','05':'noir(05)'}" size="3" key="Form.select3" multiple="true"/>
    et ça marche.

    ST

Discussions similaires

  1. Réponses: 1
    Dernier message: 05/10/2011, 12h45

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo