You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shinya Kasatani <sh...@kbmj.com> on 2002/10/21 05:42:56 UTC

[ANNOUNCE] SVT 0.5.0-beta released

Hello,

I am pleased to announce that I have released a first version of SVT
(Struts Validation Toolkit).
SVT is a form validation framework for Struts.

You can write a simple validating code in Java, rather than
writing validation.xml files.

For example, if the form bean has properties "name" and "age",
both is required, and "age" must be a number,
the validation code looks like this:

public class InputForm extends ActionForm {
    ....

    public ActionErrors validate(
        ActionMapping mapping,
        HttpServletRequest request) {

        Validator v = new Validator(getServlet(), this, mapping.getName());
        v.validate("name", Rules.required());
        v.validate("age", new Rule[] { Rules.required(), Rules.number() });
        return v.getErrors();
    }
}

You can get it from http://svt.sourceforge.net/

If you have any comments please write to svt-users@lists.sourceforge.net

-- 
Shinya Kasatani <sh...@kbmj.com>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [ANNOUNCE] SVT 0.5.0-beta released

Posted by Shinya Kasatani <sh...@kbmj.com>.
> I don't understand why you think this is better. With validation.xml, all my
> validation requirements are in one place; I don't have to look a number of
> java form files to find out what they are. And if any of them change I only
> have to edit one file, and restart struts; without needing to recompile my
> application.
> 
> Please explain how this framework provides any added value.

The reason that I made this framework was because I had to do some
conditional validation.

Depending on other field values or some other conditions,
some fields were sometimes required and sometimes weren't.

This was hard to do with XML configuration files.


And, if you have lots of large forms in your application, 
validation.xml tends to be very long and it gets hard to find
what you need, so personally I like to define the rules in 
the form bean itself.

> 
> Dave Derry
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 

-- 
Shinya Kasatani <sh...@kbmj.com>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [ANNOUNCE] SVT 0.5.0-beta released

Posted by Dave Derry <dd...@acm.org>.
----- Original Message -----
From: "Shinya Kasatani" <sh...@kbmj.com>


> Hello,
>
> I am pleased to announce that I have released a first version of SVT
> (Struts Validation Toolkit).
> SVT is a form validation framework for Struts.
>
> You can write a simple validating code in Java, rather than
> writing validation.xml files.
>

I don't understand why you think this is better. With validation.xml, all my
validation requirements are in one place; I don't have to look a number of
java form files to find out what they are. And if any of them change I only
have to edit one file, and restart struts; without needing to recompile my
application.

Please explain how this framework provides any added value.

Dave Derry


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>