Well, it still doesn't work :( A few questions : - Do I have to put the xxx-validation.xml files in a specific directory ? I put them in the WEB-INF/classes directory ... - And has the first part of the validation xml file to be the action name (name attribute in struts.xml file) or the action class name ? I didn't find it clear in the documentation ...
2007/5/9, Guillaume Carré <[EMAIL PROTECTED]>:
2007/5/9, Olivier THIERRY <[EMAIL PROTECTED]>: > Hi, > > I try to validate a form, but I can't make it work, and I don't understand > why ... > > So I have the following form in a JSP : > > <s:actionerror /> > <s:form action="submitCreerDemandeAbsence" id="form1"> > <s:textfield > id="matriculeDemandeur" > name="demandeAbsence.matriculeDemandeur" > label="Matricule" > onchange="dojo.event.topic.publish ('updateInfosDemandeurTopic', > this.value);" > required="true" > requiredposition="left" > /> > </s:form> > > > My struts.xml file is as following (the action class is Spring managed) : > > <package name="absences" namespace="/absences" extends="struts-default"> > <action name="submitCreerDemandeAbsence" > class="creerDemandeAbsenceAction"> > <interceptor-ref name="defaultStack" /> > <result > name="success">/jsp/absences/confirmerCreationDemandeAbsence.jsp</result> > </action> > </package> > > And I have the following submitCreerDemandeAbsence-validation.xml file : > > <validators> > <field name="demandeAbsence.matriculeDemandeur"> > <field-validator type="required"> > <message>Vous devez saisir ma matricule du demandeur.</message> > </field-validator> > </field> > </validators> > try <field-validator type="requiredstring"> and add an "input" result to your action results -- Guillaume Carré --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]