struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ate Douma" <...@iwise1.demon.nl>
Subject Re: Contextual Form Validation ???
Date Wed, 27 Sep 2000 21:00:19 GMT
Add an hidden form field which value will hold which submit button was =
pressed.
The Validate() method can then evaluate this submit value and perform =
conditional validation based on it.

Ate Douma
  ----- Original Message -----=20
  From: Jones, Dean=20
  To: 'struts-user@jakarta.apache.org'=20
  Cc: 'struts-dev@jakarta.apache.org'=20
  Sent: Wednesday, September 27, 2000 10:55 PM
  Subject: RE: Contextual Form Validation ???


    Yes, but, well,  A single form in a single page has only one =
action=3D"Something.do",  and only ONE
    bound form type.  I could do some JavaScript goo to change the form =
action on the fly,  but that
    still doesn't help me with contextual form validation.
    =20
    It seems somehow,  looking at ActionServlet.java,  that maybe the =
Action itself should be able to
    intercept and modify form validation,  with the default behavior =
what it is now.  Perhaps a validate()
    method with parameters,  or a new ContextualValidatingActionForm =
interface.  I need to grok the
    stateless nature of the actions a bit,  and the interplay with form =
instances a bit more...  The
    mappings,  request,  and servlet could all come into play in =
contextual validation...
    =20
    Dean S Jones


    You should use three separate Action classes to do your work with =
three different "actions" submitted by the form. E.g. PlaceOrder.do, =
ParkOrder.do, and GetQuote.do....

    HTH,=20

    Mike


Mime
View raw message