Re: Validation on java.util.List

2007-03-14 Thread cilquirm
I don't know if this helps, but when I validate a list or array , i use OGNL's selection/projection facility : i.e. : customers.{ ? #this.age gt 0 and #this.username neq null }.size() eq customers.size creates a list of all customers whose age is greater than zero and who have a username and

Re: Validation on java.util.List

2007-03-14 Thread Dave Newton
--- Alex Wibowo <[EMAIL PROTECTED]> wrote: > But that will tie up the hibernate objects to Struts, > wouldnt it? XWork, technically, but yes. The other issue (I think; haven't explored it yet) is that you'd lose the ability to validate differently based on the Action method (which I need). So I'

Re: Validation on java.util.List

2007-03-14 Thread Alex Wibowo
Hi Dave, Thanks for that.. I will have a look at the VisitorValidator tomorrow (its 1 AM here :P ) I am sort of in the same position as you (using Hibernate objects at the web layer)... I have given that a thought before (annotating the hibernate objects with validation annotation). But that wil

Re: Validation on java.util.List

2007-03-14 Thread Dave Newton
Just a quick followup regarding annotations: --- Dave Newton <[EMAIL PROTECTED]> wrote: > I don't know if this is a "better way" or not and it > does not use annotations (at least not yet), but... If you annotate the class contained in the collection the @VisitorFieldValidator still works. This

Re: Validation on java.util.List

2007-03-14 Thread Dave Newton
--- Alex Wibowo <[EMAIL PROTECTED]> wrote: > It is not the best solution.. so if you found a > better way to do it, please let me know. I don't know if this is a "better way" or not and it does not use annotations (at least not yet), but... (1) Create a validation config file for the *object* (in

Re: Validation on java.util.List

2007-03-14 Thread Alex Wibowo
Hi Dave, I came up with my own solution. Basically I wrote a method that I called manually (i.e. I didnt use expressionvalidator annotation).. in that method, i perform the check myself. If there was any error, I did addFieldError("customers[index]", getText("some.text.from.properties.file "));

Re: Validation on java.util.List

2007-03-13 Thread Dave Newton
--- Alex Wibowo <[EMAIL PROTECTED]> wrote: > I am using Struts 2.0. Has anyone ever done > validation on individual item in java.util.List > before? I'm drawing a blank on this one too after poking it with a stick for about an hour now... I have a similar requirement (but with fairly heavy inter-