Nice discussion.
I like validate() method because it can give access to ActionError objects,
so one can
easily produce internationalized error messages and forward back to input
page, and IMHO
that`s a useful feature. Just my 2 cents anyway;-)

----- Original Message -----
From: "Robert Parker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 18, 2001 12:35 PM
Subject: Re: where should validation happen?


> >From my experience there are some subtle details when using the
validate()
> method of the form bean...
> The validate method is called unless you set the validate attribute in the
> struts config to false.
> If an error is found by your validate method, struts seems to delegate
back
> to the input (jsp) as specified in the config, hence your action handlers
> perform method is not called.
> My preference is to perform basic field/type validation in the browser
using
> javascript, and business type validation I handle via beans called from my
> action handler class.
> Letting struts call the validate() method for me has given me problems -
as
> I often have my action handlers populate say collections of lookup values
> for selection lists etc. Hence if struts does not call my perform method,
my
> selection lists will be empty. Note I discovered this after I had designed
> my action handlers this way...
> regards
> Rob


Reply via email to