[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    Re: Complex validation
From:       Christian Bollmeyer <java () christianbollmeyer ! de>
Date:       2004-04-15 20:29:47
Message-ID: 200404152229.02193.java () christianbollmeyer ! de
[Download RAW message or body]

On Thursday 15 April 2004 15:36, Diego wrote:

I admit having but limited experience with Validator,
and DynaActionForm, and the reason for that is
not that it's bad in itself, but I found that complex,
in particular application specific 'dependant' validation
can be performed much easier by using traditional
ActionForms and the validate() method. That said,
I usually validate twice, once in the Presentation
tier and another time in the Business Logic, and
I almost never use or even rely on JavaScript, but
do strict server-side validation for that's a secure
area (while JavaScript can be easily turned off).
IMHO it's preferable to have the user spend an
additional roundtrip in case of inconsistent data
and issue some consolidated warnings in red
than pre-checking on the client tier via JavaScript
which ends up in a nameless message box. So
for me, the Validator generally is a good thing
(and crucial when using DynaActionForms), but
upon finding out it also has definite lackings
when doing complex validation, I dropped the
entire DynaActionForm approach and went
back to traditional ActionForms. For I found
that I finally was spending more time on
Validator XML definitions than it takes to
generate the entire ActionForm class itself
(Oracle JDev and NetBeans have a really
useful Beans editor here) and just code
the necessary validation code by hand.
The advantage is that I can see what's
happening directly in the Debugger instead
of endlessly interpreting log files and
adapting boring XML definitions. But
it's a matter of taste, after all, as always.

HTH,
-- Chris.
 

> Hi everyone. I need to perform conditional validation in one of my
> forms. I have a drop-down list and a text field. The validation
> applied to the text field should be dependent on the value selected
> on the drop-down list. Is this possible, using the Struts validator?
> I've taken a look at the "validwhen" validator but I don't see how
> could this be done. I want a solution that allows me to use
> Javascript validation.
>
> Thanks in advance.
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic