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>

But it looks like the validation is never called ...

Can you tell me what I did wrong ?

Thanks in advance

Olivier

Reply via email to