You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Martin Braure de Calignon <br...@free.fr> on 2008/01/08 23:29:06 UTC
[S2] validation on list of bean (was Validation question)
Le mardi 08 janvier 2008 à 14:08 +0100, Martin Braure de Calignon a
écrit :
Sorry I've forgot [S2] in subject
> Hello,
>
> I'm currently using struts2 for a project.
> I want to validate all elements of a list (each elements should have a
> non-empty value, or the list should be empty).
>
> what I have done in my validator is :
> <!-- correct doctype above and some field-validator-->
>
> <validator type="expression">
> <param name="expression">
> <![CDATA[
>
> ((myList.isEmpty) || (myList{? #this.value != null}.size ==
> myList.size))
> ]]>
> </param>
> <message>error ${myList.size}</message>
> </validator>
> <!-- correct end of file below this line -->
>
> Then in console I have a warning, and the validator does not do what I
> want.
> WARN - Got result of null when trying to get Boolean
> I don't know if it is related to my validator but it seems to be.
>
> Any idea on how writing validator on all elements of the list ?
>
> Thanks :-)
--
Martin Braure de Calignon