> >        String validation = mem.validate();
> >        if (validation == null) //valid

> This would be cleaner as

> if (mem.validate(data)) 

> Where the validate method calls data.addMessage to add messages > for each
> field that is invalid and returns a boolean to indicate whether > the
> object is in a valid state or not...

Definitely better than mine, but what I'm aiming for :-) is to display the error 
against each field as I redraw the page.

For example

Username    [ ]   * not supplied
...


My latest thoughts (at 3am!) are to have a boolean validate() message, which just says 
if its ok or not and then in the getHtml display extra info alongside invalid fields

I would have a common internal routine doing the validation - to avoid coding it 2 
ways for the validate() method versus the getHtml() method.

Chris
---
"There is no spoon"
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to