Re: Validation in Struts 1
That's not combining client- and server-side validation, that's combining declarative and programmatic validation, unless you're talking about the JavaScript validation method. Dave On Mon, Oct 25, 2010 at 1:52 PM, Anjib Mulepati anji...@hotmail.com wrote: Hi Can we combine client side validation and server side validation? i.e. using validation.xml as well as validation in validate() method as well. Does it make any sense? Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Validation in Struts 1
ok so is this mean both is server side validation and client side validation is done with Javascript? Also between these two(.xml and execute() method) which one is better? Any pros and cons? Anjib On 10/25/2010 1:55 PM, Dave Newton wrote: That's not combining client- and server-side validation, that's combining declarative and programmatic validation, unless you're talking about the JavaScript validation method. Dave On Mon, Oct 25, 2010 at 1:52 PM, Anjib Mulepatianji...@hotmail.com wrote: Hi Can we combine client side validation and server side validation? i.e. using validation.xml as well as validation in validate() method as well. Does it make any sense? Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Validation in Struts 1
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
Re: Validation in Struts 1
On Mon, 2010-10-25 at 14:01 -0400, Anjib Mulepati wrote: ok so is this mean both is server side validation and client side validation is done with Javascript? Also between these two(.xml and execute() method) which one is better? Any pros and cons? Anjib On 10/25/2010 1:55 PM, Dave Newton wrote: That's not combining client- and server-side validation, that's combining declarative and programmatic validation, unless you're talking about the JavaScript validation method. Dave On Mon, Oct 25, 2010 at 1:52 PM, Anjib Mulepatianji...@hotmail.com wrote: Hi Can we combine client side validation and server side validation? i.e. using validation.xml as well as validation in validate() method as well. Does it make any sense? Thanks - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Client side validation via javascripts prevents client to server communication if some error can be deal with at client side, ie, input eroor, which reduces server burden. However, server side validation is also needed because clients can walk around client side intentionally. Please correct me if I said something wrong. Qiang -- Qiang Li HuBei Polytechnic Institute No. 17 YuQuan Road XiaoGan HuBei 432100 China E-mail: liqi...@hbvtc.edu.cn - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org