There are a 1/2 dozen ways to do this at least.

Here are four of them.

1) Create an additional action-mapping with validate=false, submit to that
mapping. (someone else stated this one)

2) Override the validate method of the form look for an attribute and
selective call super class validate method. (you stated this one)

3) Use a cancel button. The request dispatcher checks to see if the cancel
button is checked and wont validate the form or populate the form if the
cancel button is checked. This might be a problem if you want the form
populated. (someone else stated this... this could be a problem if you want
the form populated as the cancel button is checked before form population)

4) Subclass the request processor check for a special atrribute being set by
your form (name of the button).
The override the following method (my suggestion):

    protected boolean processValidate(HttpServletRequest request,
                                      HttpServletResponse response,
                                      ActionForm form,
                                      ActionMapping mapping)
                                      ...





-----Original Message-----
From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 11:34 PM
To: 'Struts Users Mailing List'
Subject: Disable validator framework


Hi

    We are using dispatch action and validator framework. There is a popup
action associated
with one button on the form. When the user clicks on this a particular
method in the action is called but I don't want to validate the ActionForm
because the main form is not submitted. There are other buttons that submit
the form and I need a selective validator framework.

   I know that it is possible if I were to write my own validate() method by
checking a particular value in the form.

   Can I disable the validator similarly ? If this is not possible then I
have to abandon the validator.

    Appreciate ideas.
Mohan


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to