struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olivier THIERRY" <>
Subject Re: [S2] Can't make validation work
Date Wed, 09 May 2007 10:12:35 GMT
OK, it works now. Not perfectly, but it works.

Actually I had to name my validation file
CreerDmandeAbsenceAction-submitCreerDemandeAbsence-validation.xml, beginning
with an uppercase letter. Then I put this file in my action package as you
said. But it worked only when I set the validate attribute of my form to
true in the JSP ... When I set this attribute to false, the validation
doesn't work at all. Maybe it's because I use Ajax theme ?
But I still have problems, when i submit my form :
- I have a Javascript popup for each datetimepicker in my form (message :
"TypeError: row.cells has no properties")
- There is no validation on radio buttons ...
- When I submit my form a second time, the errors list is not reseted, so
the remaining errors are displayed twice ...
- The label for required fields turns to red ... but only for text fields
and selects, but not for datetimepickers, radio buttons or textareas ...

Moreover, is there a way to group the error messages on top of the form, and
not besides each field (I know it was the default behaviour with Struts 1
but can't find how to do it with Struts 2).

Thanks for your help ;)


2007/5/9, Guillaume Carré <>:
> 2007/5/9, Olivier THIERRY <>:
> > 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 ...
> you have to put it in the same package than your action
> > - 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 ...
> your validation file needs to have the following name:
> ActionName-alias-validation.xml
> in your example:
> creerDemandeAbsenceAction-submitCreerDemandeAbsence-validation.xml
> --
> Guillaume Carré
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message