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 1 Java Discussion :

Probleme avec Struts-config The content of element type "struts-config" must match "(data-sources?,form-beans?


Sujet :

Struts 1 Java

  1. #1
    Candidat au Club
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Mai 2011
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : Finance

    Informations forums :
    Inscription : Mai 2011
    Messages : 4
    Points : 4
    Points
    4
    Par défaut Probleme avec Struts-config The content of element type "struts-config" must match "(data-sources?,form-beans?
    Bonjour,

    Je suis un débutant en j2ee, actuellement en auto formation en struts.
    je travail sur un tutoriel que j'ai trouvé sur ce site, j'ai eu ce problème,
    dans le fichier struts-config.xml,
    The content of element type "struts-config" must match "(data-sources?,form-beans?,global-exceptions?,global- forwards?,action-mappings?,controller?,message-resources*,plug-in*)" au niveau de la balaise de debut <struts-config>.


    fichier struts-config

    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
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
     
    <struts-config>
    	<form-beans>
    		<form-bean name="authentificationForm" type="actionform.AuthentificationForm" />
    	</form-beans>
    	<!-- <global-exceptions> -->
    	<!-- <exception key="expired.password" type="app.ExpiredPasswordException" -->
    	<!-- path="/changePassword.jsp" /> -->
    	<!-- </global-exceptions> -->
     
    <!-- <global-forwards> -->
    <!-- <forward name="welcome" path="/Welcome.do" /> -->
     
    <!-- </global-forwards> -->
     
    <action-mappings>
    	<!-- <action path="/Welcome" forward="/vues/Welcome.jsp" /> -->
    	<action path="/Authentification" type="action.AuthentificationAction"
    		name="authentificationForm" scope="request" input="/vues/authentification.jsp"
    		validate="true">
    		<forward name="erreurs" path="/vues/erreurs.jsp" />
    		<forward name="succes" path="/vues/succes.jsp" />
     
    	</action>
    </action-mappings>
    <form-beans>
    	<form-bean name="authentificationDynaforms" type="org.apache.struts.action.DynaActionForm">
    		<form-property name="identifiant" type="java.lang.String"
    			initial="" />
    		<form-property name="motdepasse" type="java.lang.String"
    			initial="" />
    	</form-bean>
    </form-beans>
    <action-mappings>
    	<action path="/AuthentificationDynaforms" name="authentificationDynaforms"
    		type="org.apache.struts.actions.ForwardAction" parameter="/pages/bienvenueDynaForms.jsp">
    	</action>
    </action-mappings>
    </struts-config>
    Merci pour votre retour.

  2. #2
    Membre émérite
    Avatar de Nesmontou
    Homme Profil pro
    Architecte logiciel
    Inscrit en
    Septembre 2004
    Messages
    1 612
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 42
    Localisation : France, Nord (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Architecte logiciel
    Secteur : Finance

    Informations forums :
    Inscription : Septembre 2004
    Messages : 1 612
    Points : 2 969
    Points
    2 969
    Par défaut
    Bonjour,

    Le problème vient du fait que tu as 2 éléments <form-beans> et 2 éléments <action-mappings>.

    Les ? dans l'exception indiquent que chacun de ces éléments doit apparaître une fois maximum.

    Ton fichier devrait plutôt ressembler à ceci
    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
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC
    	"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
    	"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
    	<form-beans>
    		<form-bean name="authentificationForm" type="actionform.AuthentificationForm" />
    		<form-bean name="authentificationDynaforms" type="org.apache.struts.action.DynaActionForm">
    			<form-property name="identifiant" type="java.lang.String" initial="" />
    			<form-property name="motdepasse" type="java.lang.String" initial="" />
    		</form-bean>
    	</form-beans>
     
    	<action-mappings>
    		<action
    			path="/Authentification"
    			type="action.AuthentificationAction"
    			name="authentificationForm"
    			scope="request"
    			input="/vues/authentification.jsp"
    			validate="true">
    			<forward name="erreurs" path="/vues/erreurs.jsp" />
    			<forward name="succes" path="/vues/succes.jsp" />
    		</action>
    		<action
    			path="/AuthentificationDynaforms"
    			name="authentificationDynaforms"
    			type="org.apache.struts.actions.ForwardAction"
    			parameter="/pages/bienvenueDynaForms.jsp">
    		</action>
    	</action-mappings>
    </struts-config>
    Bon développement
    Si vous ne pouvez expliquer un concept à un enfant de six ans, c'est que vous ne le comprenez pas complètement. Albert EINSTEIN

    F.A.Q. : Java, PHP, (X)HTML / CSS

    N'oubliez pas de cliquer sur le bouton Résolu en bas de page quand vous avez obtenu une solution à votre problème

  3. #3
    Candidat au Club
    Homme Profil pro
    Conseil - Consultant en systèmes d'information
    Inscrit en
    Mai 2011
    Messages
    4
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Conseil - Consultant en systèmes d'information
    Secteur : Finance

    Informations forums :
    Inscription : Mai 2011
    Messages : 4
    Points : 4
    Points
    4
    Par défaut
    Bonjour,
    merci pour votre repense Nesmontou.

    cordialement.

Discussions similaires

  1. [JAXB] Erreur "cvc-complex-type.2.4.b: The content of element 'ns2:Records' is not complete."
    Par scalpa63 dans le forum Format d'échange (XML, JSON...)
    Réponses: 3
    Dernier message: 03/12/2012, 08h34
  2. probleme avec fusion de 2 llc trié element par element !
    Par Tshik3StyLe dans le forum Débuter
    Réponses: 1
    Dernier message: 03/05/2009, 04h10
  3. [XSLT] [Fatal Error] sommaire_T6.xsl:15:2: The content of elements must consist of well-form
    Par lasdou15 dans le forum Format d'échange (XML, JSON...)
    Réponses: 3
    Dernier message: 13/03/2008, 09h02
  4. [HTML] probleme avec <meta http-equiv="Content-Style-Type" content="text/css"> ?
    Par lysandre dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 16/01/2008, 16h42
  5. Réponses: 3
    Dernier message: 29/05/2007, 20h37

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