On Mon, Oct 25, 2010 at 2:01 PM, Anjib Mulepati <anji...@hotmail.com> wrote:
> ok so is this mean both is server side validation and client side validation 
> is done with Javascript?

???

No. Client-side validation is done with JavaScript, because that's
what runs inside browsers. Server-side validation is done in Java,
whether or not it's driven by XML.

> Also between these two(.xml and execute() method) which one is better? Any
> pros and cons?

execute() method? Do you mean the validate() method? Neither is
better--they're different things. XML/declarative validation is more
useful for simple validations: length, masks, etc. The validate()
method is more useful for business-logic-oriented validation, like "if
a business has a flag set then we only allow US addresses" or
something along those lines.

The two are combinable; use XML for easy stuff, validate() for hard stuff.

Dave

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

Reply via email to