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 :

jee struts tiles et Validator


Sujet :

Struts 1 Java

  1. #1
    Membre averti
    Inscrit en
    Février 2009
    Messages
    34
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 34
    Par défaut jee struts tiles et Validator
    salut
    je suis nouvelle on developpement struts la je veus utiliser les tiels

    voila la version de struts que j'utilise
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.1
    Created-By: 1.3.1_04-b02 (Sun Microsystems Inc.)
    Extension-Name: Struts Framework
    Specification-Title: Struts Framework
    Specification-Vendor: The Apache Software Foundation
    Specification-Version: 1.2.9
    Implementation-Title: Struts Framework
    Implementation-Vendor: The Apache Software Foundation
    Implementation-Vendor-Id: org.apache
    Implementation-Version: 1.2.9
    Class-Path:  commons-beanutils.jar commons-digester.jar commons-fileup
     load.jar commons-logging.jar commons-validator.jar jakarta-oro.jar

    pour travaillé les tiles il me faut depuis ce que j'ai vue sur internet

    un struts-tiles.tld qui doit etre couler sous WEB-INF/
    et tiles.jar qui doit etre placer WEB-INF/lib/

    dans la version de struts je vois qui me monquer
    struts-tiles.tld
    et tiles.jar
    j'ai bien chercher mais j rien trouvé sino si qlq une idéé sur tt ca

  2. #2
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Les tiles sont intégrés dans le jar de Struts et la tld aussi, dans le répertoire META-INF/tlds.

  3. #3
    Membre averti
    Inscrit en
    Février 2009
    Messages
    34
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 34
    Par défaut

    merci j'ai bien trouvé tous dans une application (Les tiles )
    pour le moment je suis a la recherche d'une application fait par struts validateur pour recuperer le file

    struts-validator.tld

    pour
    validator-rules.xml je dois le construire moi meme
    si tu a une application simple fait en struts validator je serai tres reconnaissant
    merci pour tte les information que tu ma procurer

  4. #4
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Il n'existe pas de tld pour le Validator et tu dois prendre le fichier validator-rules.xml livré avec la version de Struts que tu utilises, soit dans ton cas la 1.2.9. Ce fichier contient les règles de validation fournies en standard par le Validator.

    Tu dois par contre créer un fichier validation.xml dans lequel tu vas spécifier quelles règles de validation du Validator tu souhaites appliquer sur tes formulaires.
    Tu trouveras un exemple dans la FAQ.

    Ces deux fichiers doivent être référencés dans une balise plugin du struts-config.xml :
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
      <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
    </plug-in>
    Tu peux aussi suivre les indications données sur le site de Struts ici.

  5. #5
    Membre averti
    Inscrit en
    Février 2009
    Messages
    34
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 34
    Par défaut
    je pense que les chose ne sont pas tres claire pour moi

    voila struts-config.xml
    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
     
     
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
    "http://struts.apache.org/dtds/struts-config_1_2.dtd">
    <struts-config>
    	<form-beans>
    		<form-bean name="formldayneague"
    			type="org.apache.struts.validator.DynaValidatorForm">
    			<form-property name="seasond" type="java.lang.String" />
    			<form-property name="titled" type="java.lang.String" />
    			<form-property name="yearStrd" type="java.lang.String" />
    		</form-bean>
    	</form-beans>
    	<action-mappings>
     
    		<action path="/maindyn" name="formldayneague" validate="true"
    			input="/erreursdyna.do" type="pack1.FormulaireAction">
    			<forward name="respon" path="/respon.do" />
    		</action>
    		<action path="/erreursdyna" parameter="/erreursdyna.jsp"
    			type="org.apache.struts.actions.ForwardAction" />
    		<action path="/respon" parameter="/respon.jsp"
    			type="org.apache.struts.actions.ForwardAction" />
    	</action-mappings>
     
    	<message-resources parameter="eror" " />
    	<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    		<set-property property="pathnames"
    			value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
    	</plug-in>
    </struts-config>
    voila le validateur.xml
    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
     
    <?xml version="1.0" encoding="iso-8859-1"?>
    <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons ... Configuration 1.1.3//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
    <form-validation>
    	<formset language="">
    		<form name="formldayneague">
    			<field property="seasond" depends="required">
    				<arg0 key="valide.seasond" />
    			</field>
    			<field property="titled" depends="required">
    				<arg0 key="valide.titled" />
    			</field>
    			<field property="yearStrd" depends="required">
    				<arg0 key="valide.yearStrd" />
    			</field>
    		</form>
    	</formset>
    </form-validation>
    ma page welcome.jsp formulaire
    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
     
     
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>welcom to dyna</title>
    </head>
    <body>
     
    <html:form action="maindyn.do" > 
    Title: <html:text property="titled" value="karim"></html:text>
    	<br>
    Year<html:text property="yearStrd" value="2005"></html:text>
    	<br>
    Season<html:select property="seasond" value="unknown">
    		<html:option value="unknown">........</html:option>
    		<html:option value="spring">spring</html:option>
    		<html:option value="other">other</html:option>
     
    	</html:select>
    	<br>
    	<html:submit>G--O</html:submit>
     
    </html:form>
     
    </body>
    </html>
    page jsp qui affiche les erreur erreursdyna.jsp

    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
     
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
     
    <h2>Les erreurs sous daynaform</h2>
    <html:errors />
    <html:link page="/welcom2.jsp"> return to principale page </html:link>
    </body>
    </html>
    la page de reponse qui affiche les donné en cas pas d'erreur respon.jsp
    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
     
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <h2> voila tout les donné sur dayna  </h2><br>
    le Title : <%=request.getAttribute("titled") %><br>
    la Seasion : <%=request.getAttribute("seasond") %><br>
    the  Year  : <%=request.getAttribute("yearStrd") %><br>
     
    <html:link page="/welcom2.jsp"> return to principale page </html:link>
    </body>
    </html>
    voila en piecejoint la liste des libe
    voila l'action FormulaireAction
    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
     
    package pack1;
     
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
     
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.DynaActionForm;
    import org.apache.struts.validator.DynaValidatorForm;
     
    public class FormulaireAction extends Action{
     
    	public ActionForward execute(ActionMapping mapping, ActionForm form,
    			HttpServletRequest req, HttpServletResponse res) throws Exception{
    		DynaValidatorForm op= (DynaValidatorForm)form;
    		req.setAttribute("seasond",op.get("seasond"));
    		req.setAttribute("titled",op.get("titled"));
    		req.setAttribute("yearStrd",op.get("yearStrd"));
     
    		return mapping.findForward("respon") ;
     
    }
     
    }
    pour le validator-rules.xml
    j'ai creé mais il est vide !!!!
    dans la version de Struts que tu utilises je n pas trouvé
    possible qui a un probleme c pour ca que je cherche un application ou il a le tt

    merci de m'avoir aider un jours je serai expert en struts

  6. #6
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Quand tu télécharges Struts, tu dois trouver le fichier validator-rules.xml dans le répertoire lib.
    Il faut donc le copier sous WEB-INF.

  7. #7
    Membre averti
    Inscrit en
    Février 2009
    Messages
    34
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 34
    Par défaut
    bon soir j'ai bien chercher mais je n pas trouver
    ds mon struts 1.2.9 il n pas de validator-rules.xml ni ds une autre version que j'ai telecharger struts-2.1.6 dans lib il a que les jar et donne commons-validator-1.3.1 j'ai trouvé 'digester-rules.xml' apres compresion
    dans ce chemein
    struts-2.1.6\lib\commons-validator-1.3.1\org\apache\commons\validator
    par contre j'ai trouvé une file deja ecrire le voila



    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
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
     
    !DOCTYPE form-validation PUBLIC
              "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1//EN"
              "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd">
    <!--
      $Header: /home/cvs/jakarta-struts/conf/share/validator-rules.xml,v 1.48 2003/12/11 05:52:58 rleland Exp $
      $Revision: 1.48 $
      $Date: 2003/12/11 05:52:58 $
     
       This file contains the default Struts Validator pluggable validator
       definitions.  It should be placed somewhere under /WEB-INF and
       referenced in the struts-config.xml under the plug-in element
       for the ValidatorPlugIn.
     
          <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
            <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
                                                      /WEB-INF/validation.xml"/>
          </plug-in>
     
       These are the default error messages associated with
       each validator defined in this file.  They should be
       added to your projects ApplicationResources.properties
       file or you can associate new ones by modifying the
       pluggable validators msg attributes in this file.
     
       # Struts Validator Error Messages
       errors.required={0} is required.
       errors.minlength={0} can not be less than {1} characters.
       errors.maxlength={0} can not be greater than {1} characters.
       errors.invalid={0} is invalid.
     
       errors.byte={0} must be a byte.
       errors.short={0} must be a short.
       errors.integer={0} must be an integer.
       errors.long={0} must be a long.
       errors.float={0} must be a float.
       errors.double={0} must be a double.
     
       errors.date={0} is not a date.
       errors.range={0} is not in the range {1} through {2}.
       errors.creditcard={0} is an invalid credit card number.
       errors.email={0} is an invalid e-mail address.
     
       Note: Starting in Struts 1.2.0 the default javascript definitions have
             been consolidated to commons-validator. The default can be overridden
             by supplying a <javascript> element with a CDATA section, just as
             in struts 1.1.
     
    -->
     
    <form-validation>
     
       <global>
     
          <validator name="required"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateRequired"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                      msg="errors.required"/>
     
          <validator name="requiredif"
                     classname="org.apache.struts.validator.FieldChecks"
                     method="validateRequiredIf"
                     methodParams="java.lang.Object,
                                   org.apache.commons.validator.ValidatorAction,
                                   org.apache.commons.validator.Field,
                                   org.apache.struts.action.ActionMessages,
                                   org.apache.commons.validator.Validator,
                                   javax.servlet.http.HttpServletRequest"
                     msg="errors.required"/>
     
          <validator name="validwhen"
              msg="errors.required"
                     classname="org.apache.struts.validator.validwhen.ValidWhen"
                     method="validateValidWhen"
                     methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"/>
     
     
          <validator name="minlength"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateMinLength"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.minlength"
               jsFunction="org.apache.commons.validator.javascript.validateMinLength"/>
     
     
          <validator name="maxlength"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateMaxLength"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.maxlength"
               jsFunction="org.apache.commons.validator.javascript.validateMaxLength"/>
     
     
     
          <validator name="mask"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateMask"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.invalid"/>
     
     
          <validator name="byte"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateByte"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.byte"
           jsFunctionName="ByteValidations"/>
     
     
          <validator name="short"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateShort"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.short"
           jsFunctionName="ShortValidations"/>
     
     
          <validator name="integer"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateInteger"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.integer"
           jsFunctionName="IntegerValidations"/>
     
     
     
          <validator name="long"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateLong"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.long"/>
     
     
          <validator name="float"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateFloat"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.float"
           jsFunctionName="FloatValidations"/>
     
          <validator name="double"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateDouble"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.double"/>
     
     
          <validator name="date"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateDate"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.date"
           jsFunctionName="DateValidations"/>
     
     
          <validator name="intRange"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateIntRange"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends="integer"
                      msg="errors.range"/>
     
     
          <validator name="floatRange"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateFloatRange"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends="float"
                      msg="errors.range"/>
     
     
     
          <validator name="creditCard"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateCreditCard"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.creditcard"/>
     
     
          <validator name="email"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateEmail"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.email"/>
     
     
       </global>
     
    </form-validation>

    j'ai deja cree un file donne lib qui le meme nom validator-rules.xml normalemnt il est vide si je fait copie coller de ce code les chose peus marcher


    merci pour votre aide

  8. #8
    Membre averti
    Inscrit en
    Février 2009
    Messages
    34
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 34
    Par défaut
    une remarque quand je fait copie coller il me donne une croix rouge
    Content is not allowed in prolog.

    je ne sais koi fair

  9. #9
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    C'est surprenant qu'il n'y ait pas de fichier validator-rules.xml.
    Avec la 1.2.7, j'en ai un dans le répertoire lib.

    Sinon, l'erreur est dû au fait qu'il manque un < devant !DOCTYPE :
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    <!DOCTYPE form-validation PUBLIC ...>

    Le problème, c'est que la version du fichier validator-rules.xml que tu as trouvé ne correspond pas à ta version de Struts.
    Cela peut générer des erreurs.

    Il faudrait donc modifier la référence à la dtd pour pointer sur la bonne version.
    Peux-tu préciser quelle version de commons-validator tu as ?

  10. #10
    Membre averti
    Inscrit en
    Février 2009
    Messages
    34
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 34
    Par défaut
    j'ai cherché dans
    WebContent\WEB-INF\lib\commons-validator\META-INF\MANIFEST.MF

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.5.3 
    Created-By: Apache Maven
    Built-By: Niall Pemberton
    Package: org.apache.commons.validator
    Build-Jdk: 1.4.2_05
    Extension-Name: commons-validator
    Specification-Title: Commons Validator
    Specification-Vendor: The Apache Software Foundation
    Implementation-Title: org.apache.commons.validator
    Implementation-Vendor: The Apache Software Foundation
    Implementation-Version: 1.1.4
    je pense que c'est la version 1.1.4 de commons-validator.

    juste une precision voila l'ensemble d'elements que j'ai dans lib :
    commons-fileupload-1.0.jar
    antlr.jar
    commons-beanutils.jar
    commons-digester.jar
    commons-logging.jar
    commons-validator.jar
    jakarta-oro.jar
    struts.jar
    possible qu'il me manque autre chose
    sinon le code il est bon (que j'ai envoyé vers 20h38)
    car quand j execute il me donne le message suivant

    8 févr. 2009 19:53:53 org.apache.catalina.core.StandardWrapperValve invoke
    INFO: La servlet action est actuellement indisponible
    merci

  11. #11
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Apparemment, pour la 1.1.4, il faut définir la dtd suivante dans le fichier validator-rules.xml :
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <!DOCTYPE form-validation PUBLIC
              "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.2.0//EN"
              "http://jakarta.apache.org/commons/dtds/validator_1_2_0.dtd">

  12. #12
    Membre averti
    Inscrit en
    Février 2009
    Messages
    34
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 34
    Par défaut
    ca marche et aussi avec
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons ... Configuration 1.1.3//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
    que j'ai trouve dans validation.xml

    le probleme reste il n a pas de renvoi vers la page erreurs.jsp avec les message d'erreur ?????
    il me renvoi tjs dans la page respons.jsp comme koi il a pas d'erreur portant j'ai bien mis donne validation.xml

    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
     
     
    <form-validation>
    	<formset language="">
    		<form name="formldayneague">
    			<field property="seasond" depends="required">
    				<arg0 key="valide.seasond" />
    			</field>
    			<field property="titled" depends="required">
    				<arg0 key="valide.titled" />
    			</field>
    			<field property="yearStrd" depends="required">
    				<arg0 key="valide.yearStrd" />
    			</field>
    		</form>
    	</formset>
    </form-validation>
    et donne le struts-config.xml

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    <action path="/maindyn" name="formldayneague" validate="true"
    			input="/erreursdyna.do" type="pack1.FormulaireAction">
    			<forward name="respon" path="/respon.do" />
    		</action>
    		<action path="/erreursdyna" parameter="/erreursdyna.jsp"
    			type="org.apache.struts.actions.ForwardAction" />
    		<action path="/respon" parameter="/respon.jsp"
    			type="org.apache.struts.actions.ForwardAction" />

  13. #13
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Dans la jsp welcome.jsp, tu as mis des valeurs dans les champs.
    Quand tu testes, tu vides bien les champs ?

    Sinon, cela change-t'il quelque chose si tu références directement la page jsp d'erreurs dans l'attribut input :
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    <action path="/maindyn" name="formldayneague" validate="true"
    	input="/erreursdyna.jsp" type="pack1.FormulaireAction">
    	<forward name="respon" path="/respon.do" />
    </action>

  14. #14
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Et as-tu bien défini les messages d'erreurs du Validator dans le fichier eror.properties comme indiqué dans la FAQ et aussi valide.seasond, valide.titled et valide.yearStrd ?

  15. #15
    Membre averti
    Inscrit en
    Février 2009
    Messages
    34
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 34
    Par défaut
    oui oui les chose ne sont pas claire mais pas au niveau de la page d'erreur
    car de tt facon meme en laissant tt vide il me renvoi a la page respons
    je pense que la validation ne ce fait po
    je ne suis pas sur que se santaxe et correcte
    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
    <form-validation>
    	<formset language="">
    		<form name="formldayneague">
    			<field property="seasond" depends="required">
    				<arg0 key="valide.seasond" />
    			</field>
    			<field property="titled" depends="required">
    				<arg0 key="valide.titled" />
    			</field>
    			<field property="yearStrd" depends="required">
    				<arg0 key="valide.yearStrd" />
    			</field>
    		</form>
    	</formset>
    </form-validation>
    dont je suis sur et le eror.properties

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    error.yeardField.required=<li>no year</li>
    error.yeardField.range=<li>year no valide</li>
    error.seasondField.range=<li>no season</li>
    error.titledField.required=<li>no title</li>
     
     
    valide.seasond=seasond
    valide.titled=titled
    valide.yearStrd=yearStrd
    ???????
    est ce que c correcte
    ou je doit mettre error.titledField.required par exemple au niveau de validation.xml
    je suis entraine de vérifier

    a suivre .....

  16. #16
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    Les messages d'erreur à définir dans le fichier eror.properties sont les suivants :
    # -- standard errors --
    errors.header=<UL>
    errors.prefix=<LI>
    errors.suffix=</LI>
    errors.footer=</UL>
    # -- validator --
    errors.required={0} is required.
    errors.minlength={0} can not be less than {1} characters.
    errors.maxlength={0} can not be greater than {1} characters.
    errors.invalid={0} is invalid.

    errors.byte={0} must be a byte.
    errors.short={0} must be a short.
    errors.integer={0} must be an integer.
    errors.long={0} must be a long.
    errors.float={0} must be a float.
    errors.double={0} must be a double.

    errors.date={0} is not a date.
    errors.range={0} is not in the range {1} through {2}.
    errors.creditcard={0} is an invalid credit card number.
    errors.email={0} is an invalid e-mail address.
    Ils sont d'ailleurs précisés dans les commentaires du fichier validator-rules.xml.

    Et tu devrais y ajouter ceci :
    valide.seasond=season
    valide.titled=title
    valide.yearStrd=year
    et donc, pour la règle de validation required, dans le cas d'une erreur de validation, il t'affichera le message :
    season is required
    dans une balise <ul><li>

    Et sinon, je viens de télécharger la version 1.2.9 de Struts et j'ai bien trouvé le fichier validator-rules.xml suivant dans le répertoire lib :
    Code xml : 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
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    <!DOCTYPE form-validation PUBLIC
              "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
              "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
    <!--
      $Id: validator-rules.xml 159291 2005-03-28 20:19:29Z niallp $
     
       This file contains the default Struts Validator pluggable validator
       definitions.  It should be placed somewhere under /WEB-INF and
       referenced in the struts-config.xml under the plug-in element
       for the ValidatorPlugIn.
     
          <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
            <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
                                                      /WEB-INF/validation.xml"/>
          </plug-in>
     
       These are the default error messages associated with
       each validator defined in this file.  They should be
       added to your projects ApplicationResources.properties
       file or you can associate new ones by modifying the
       pluggable validators msg attributes in this file.
     
       # Struts Validator Error Messages
       errors.required={0} is required.
       errors.minlength={0} can not be less than {1} characters.
       errors.maxlength={0} can not be greater than {1} characters.
       errors.invalid={0} is invalid.
     
       errors.byte={0} must be a byte.
       errors.short={0} must be a short.
       errors.integer={0} must be an integer.
       errors.long={0} must be a long.
       errors.float={0} must be a float.
       errors.double={0} must be a double.
     
       errors.date={0} is not a date.
       errors.range={0} is not in the range {1} through {2}.
       errors.creditcard={0} is an invalid credit card number.
       errors.email={0} is an invalid e-mail address.
     
       Note: Starting in Struts 1.2.0 the default javascript definitions have
             been consolidated to commons-validator. The default can be overridden
             by supplying a <javascript> element with a CDATA section, just as
             in struts 1.1.
     
    -->
     
    <form-validation>
     
       <global>
     
          <validator name="required"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateRequired"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                      msg="errors.required"/>
     
          <validator name="requiredif"
                     classname="org.apache.struts.validator.FieldChecks"
                     method="validateRequiredIf"
                     methodParams="java.lang.Object,
                                   org.apache.commons.validator.ValidatorAction,
                                   org.apache.commons.validator.Field,
                                   org.apache.struts.action.ActionMessages,
                                   org.apache.commons.validator.Validator,
                                   javax.servlet.http.HttpServletRequest"
                     msg="errors.required"/>
     
          <validator name="validwhen"
              msg="errors.required"
                     classname="org.apache.struts.validator.validwhen.ValidWhen"
                     method="validateValidWhen"
                     methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"/>
     
     
          <validator name="minlength"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateMinLength"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.minlength"
               jsFunction="org.apache.commons.validator.javascript.validateMinLength"/>
     
     
          <validator name="maxlength"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateMaxLength"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.maxlength"
               jsFunction="org.apache.commons.validator.javascript.validateMaxLength"/>
     
     
     
          <validator name="mask"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateMask"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.invalid"/>
     
     
          <validator name="byte"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateByte"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.byte"
           jsFunctionName="ByteValidations"/>
     
     
          <validator name="short"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateShort"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.short"
           jsFunctionName="ShortValidations"/>
     
     
          <validator name="integer"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateInteger"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.integer"
           jsFunctionName="IntegerValidations"/>
     
     
     
          <validator name="long"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateLong"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.long"/>
     
     
          <validator name="float"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateFloat"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.float"
           jsFunctionName="FloatValidations"/>
     
          <validator name="double"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateDouble"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.double"/>
     
     
          <validator name="date"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateDate"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.date"
           jsFunctionName="DateValidations"/>
     
     
          <validator name="intRange"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateIntRange"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends="integer"
                      msg="errors.range"/>
     
     
          <validator name="floatRange"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateFloatRange"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends="float"
                      msg="errors.range"/>
     
          <validator name="doubleRange"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateDoubleRange"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends="double"
                      msg="errors.range"/>
     
     
          <validator name="creditCard"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateCreditCard"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.creditcard"/>
     
     
          <validator name="email"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateEmail"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.email"/>
     
          <validator name="url"
                classname="org.apache.struts.validator.FieldChecks"
                   method="validateUrl"
             methodParams="java.lang.Object,
                           org.apache.commons.validator.ValidatorAction,
                           org.apache.commons.validator.Field,
                           org.apache.struts.action.ActionMessages,
                           org.apache.commons.validator.Validator,
                           javax.servlet.http.HttpServletRequest"
                  depends=""
                      msg="errors.url"/>
     
         <!--
           This simply allows struts to include the validateUtilities into a page, it should
           not be used as a validation rule.
         -->
         <validator name="includeJavaScriptUtilities"
                classname=""
                   method=""
             methodParams=""
                  depends=""
                      msg=""
               jsFunction="org.apache.commons.validator.javascript.validateUtilities"/>
     
       </global>
     
    </form-validation>

  17. #17
    Membre averti
    Inscrit en
    Février 2009
    Messages
    34
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 34
    Par défaut
    est ce que je suis ds la bonne route

  18. #18
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    As-tu lu mon message précédent ?

  19. #19
    Membre averti
    Inscrit en
    Février 2009
    Messages
    34
    Détails du profil
    Informations forums :
    Inscription : Février 2009
    Messages : 34
    Par défaut
    YYYYYYYYYYYYYYYYYYYYYYYYYYepi
    ca marche merci c_nvy
    tu es
    merci non 1000 merci et +
    alors la le spectacle va commancer

  20. #20
    Expert confirmé

    Femme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    5 793
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2005
    Messages : 5 793
    Par défaut
    En fait, j'ai oublié de préciser que si tu ne veux pas utiliser les messages par défaut du Validator, tu peux ajouter une balise msg dans la balise field dans le fichier validation.xml comme ceci :
    Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    <field property="yearStrd" depends="required">
       <msg name="required" key="error.yeardField.required"/>
       <arg0 key="valide.yearStrd" />
    </field>

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. [STRUTS][TILES] Problème sur actions génériques
    Par xv-mnt dans le forum Struts 1
    Réponses: 1
    Dernier message: 02/08/2005, 10h15
  2. [STRUTS] Nested tags validation - Client side
    Par SEMPERE Benjamin dans le forum Struts 1
    Réponses: 3
    Dernier message: 18/07/2005, 13h21
  3. [Struts][Tiles] petite question
    Par DeeJimy dans le forum Struts 1
    Réponses: 1
    Dernier message: 04/07/2005, 13h04
  4. [Struts][Tiles] Probleme d'action mapping avec un dynaform
    Par bluefox_du_974 dans le forum Struts 1
    Réponses: 3
    Dernier message: 28/03/2005, 22h47
  5. [Struts 1.2] : validation coté serveur
    Par richard_34b dans le forum Struts 1
    Réponses: 3
    Dernier message: 15/09/2004, 15h42

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