The general thinking is that there are at least two levels of
validation. First, there is the simple domain-type checking, such as
fields that are suppose to be numeric should contain only numerals.
Second, there is business-logic checking, like invoice numbers are all
greater than 1000 or no start dates should occur before 1984, or that
the username and password match. 

The first type is easy to automate and doesn't require access to the
business logic, so we have a standard method that you can override if
you want to do that as part of your ActionForm. With that method, there
would not be a good place for you to plug-in simple validations.

The second type gets to be application specific, and is usually handled
in the Action perform method. Since you are already overriding perform,
there didn't seem to be much value in providing a yet another method to
override here. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/


"Gogineni, Pratima" wrote:
> Please let me know if I am missing something / got something wrong ...
>
>I which case should we not have a validate method in the action classes too?
>
> On second thoughts ...I guess if there is some validation common to all the
> actions its probably better to place it in the actionform even if it means
> looking at information outside the view/form itself?
> I which case should we not have a validate method in the action classes too?
> 
> Thanks
> Pratima

Reply via email to