You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rajeshwari Godbole <rg...@gmail.com> on 2009/02/19 07:02:16 UTC

To use Struts Validation or not?

Hi all,

Our team here has developed a portal using Struts2. Most of the developers
have used javascript to validate the forms. I know using the Struts
validation framework is a better way to do this but I think this was avoided
in the project due to the (perceived) cumbersome setup (xml file, rules etc)
required as well as a lack of knowledge on why this is better. Could you
guys help me make a list of why validation should be handled using the
framework (the pros and cons basically).

Thanks,

Rajeshwari

Re: To use Struts Validation or not?

Posted by Wes Wannemacher <we...@wantii.com>.
On Thursday 19 February 2009 01:02:16 Rajeshwari Godbole wrote:
> Hi all,
>
> Our team here has developed a portal using Struts2. Most of the developers
> have used javascript to validate the forms. I know using the Struts
> validation framework is a better way to do this but I think this was
> avoided in the project due to the (perceived) cumbersome setup (xml file,
> rules etc) required as well as a lack of knowledge on why this is better.
> Could you guys help me make a list of why validation should be handled
> using the framework (the pros and cons basically).
>
> Thanks,
>
> Rajeshwari

Well, one good reason is the NOSCRIPT add-on for Firefox... If validation is 
central to your app, and it can be so easily by-passed, you could expose 
yourself to some risk (bad data, or *gasp* security holes!!). 

Another is that the ability to add converters and validators to your project 
and the ease of re-use. I mean, coding validation for each form field 
stinks... 

-Wes

-- 

Wes Wannemacher
Author - Struts 2 In Practice 
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher


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