|
From: Steven D. <ste...@gm...> - 2005-04-09 13:10:10
|
Hi guys,
Do you guys support the notion of validators like XWork validators?
Since WebFlow uses Spring validators could be configured
declaratively. If you're interested I would be happy to create a BNF
file for something like this:
{ firstname : length of form.firstname > 0 : "First name must not be empty" }
{ firstname : length of form.firstname <= 30 : "First name must be no
longer than 30 characters" }
{ age : form.age is number : "[${form.age}] is not a valid number" }
{ age : form.age > 18 : "You must be 18 years or older" }
{ age : form.age <= 110 : "We do not do business with the undead" }
Kind regards
Steven Devijver
--
"If you want to be a different fish, you gotta jump out of the school."
-- Captain Beefheart
|
|
From: Erwin V. <erw...@er...> - 2005-04-09 13:34:31
|
At the moment SWF does not have any direct binding & validation support of
its own: it just uses the Spring binding and validation infrastructure
(DataBinder, Errors, Validator). I don't think binding and validation is
really a feature that we should build *into* SWF. Instead we need to
integrate with existing solutions.
Could you elaborate on the "XWork validators" a bit?
Erwin Vervaet
erw...@er...
----- Original Message -----
From: "Steven Devijver" <ste...@gm...>
To: <spr...@li...>
Sent: Saturday, April 09, 2005 3:09 PM
Subject: [Springframework-developer] webflow: validators
> Hi guys,
>
> Do you guys support the notion of validators like XWork validators?
> Since WebFlow uses Spring validators could be configured
> declaratively. If you're interested I would be happy to create a BNF
> file for something like this:
>
> { firstname : length of form.firstname > 0 : "First name must not be
> empty" }
> { firstname : length of form.firstname <= 30 : "First name must be no
> longer than 30 characters" }
> { age : form.age is number : "[${form.age}] is not a valid number" }
> { age : form.age > 18 : "You must be 18 years or older" }
> { age : form.age <= 110 : "We do not do business with the undead" }
>
> Kind regards
>
> Steven Devijver
>
> --
> "If you want to be a different fish, you gotta jump out of the school."
> -- Captain Beefheart
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
|
|
From: Steven D. <ste...@gm...> - 2005-04-09 13:45:24
|
> At the moment SWF does not have any direct binding & validation support of
> its own: it just uses the Spring binding and validation infrastructure
> (DataBinder, Errors, Validator). I don't think binding and validation is
> really a feature that we should build *into* SWF. Instead we need to
> integrate with existing solutions.
I hear you. It's just that I really would like to see declarative
validation rules. Besides, a validator that would support this would
simply be a specialization of the Validator interface.
>
> Could you elaborate on the "XWork validators" a bit?
>
This example says it all:
<validators>
<field name="bar">
<field-validator type="required">
<message>You must enter a value for bar.</message>
</field-validator>
<field-validator type="int">
<param name="min">6</param>
<param name="max">10</param>
<message>bar must be between ${min} and ${max}, current
value is ${bar}.</message>
</field-validator>
</field>
<field name="date">
<field-validator type="date">
<param name="min">12/22/2002</param>
<param name="max">12/25/2002</param>
<message>The date must be between 12-22-2002 and
12-25-2002.</message>
</field-validator>
</field>
<field name="foo">
<field-validator type="int">
<param name="min">0</param>
<param name="max">100</param>
<message key="foo.range">Could not find foo.range!</message>
</field-validator>
</field>
<validator type="expression">
<param name="expression">foo > bar</param>
<message>Foo must be greater than Bar. Foo = ${foo}, Bar =
${bar}.</message>
</validator>
</validators>
|
|
From: Erwin V. <erw...@er...> - 2005-04-09 14:27:44
|
This doesn't seem to be specific to SWF: as you say, in theory it's just a
special, configurable Validator implementation (we actually made a
commons-attributes driven validator on my current project). What is the
status of "declarative input validation with Spring" in general? Is there
anything in the sandbox? Integration with commons-validator or XWork
validators?
Erwin Vervaet
erw...@er...
----- Original Message -----
From: "Steven Devijver" <ste...@gm...>
To: <spr...@li...>
Sent: Saturday, April 09, 2005 3:44 PM
Subject: Re: [Springframework-developer] webflow: validators
>> At the moment SWF does not have any direct binding & validation support
>> of
>> its own: it just uses the Spring binding and validation infrastructure
>> (DataBinder, Errors, Validator). I don't think binding and validation is
>> really a feature that we should build *into* SWF. Instead we need to
>> integrate with existing solutions.
>
> I hear you. It's just that I really would like to see declarative
> validation rules. Besides, a validator that would support this would
> simply be a specialization of the Validator interface.
>
>>
>> Could you elaborate on the "XWork validators" a bit?
>>
> This example says it all:
>
> <validators>
> <field name="bar">
> <field-validator type="required">
> <message>You must enter a value for bar.</message>
> </field-validator>
> <field-validator type="int">
> <param name="min">6</param>
> <param name="max">10</param>
> <message>bar must be between ${min} and ${max}, current
> value is ${bar}.</message>
> </field-validator>
> </field>
> <field name="date">
> <field-validator type="date">
> <param name="min">12/22/2002</param>
> <param name="max">12/25/2002</param>
> <message>The date must be between 12-22-2002 and
> 12-25-2002.</message>
> </field-validator>
> </field>
> <field name="foo">
> <field-validator type="int">
> <param name="min">0</param>
> <param name="max">100</param>
> <message key="foo.range">Could not find foo.range!</message>
> </field-validator>
> </field>
> <validator type="expression">
> <param name="expression">foo > bar</param>
> <message>Foo must be greater than Bar. Foo = ${foo}, Bar =
> ${bar}.</message>
> </validator>
> </validators>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
|
|
From: Steven D. <ste...@gm...> - 2005-04-09 14:30:38
|
Good point, I'll have a look at that.
On Apr 9, 2005 4:29 PM, Erwin Vervaet <erw...@er...> wrote:
> This doesn't seem to be specific to SWF: as you say, in theory it's just a
> special, configurable Validator implementation (we actually made a
> commons-attributes driven validator on my current project). What is the
> status of "declarative input validation with Spring" in general? Is there
> anything in the sandbox? Integration with commons-validator or XWork
> validators?
>
> Erwin Vervaet
> erw...@er...
> ----- Original Message -----
> From: "Steven Devijver" <ste...@gm...>
> To: <spr...@li...>
> Sent: Saturday, April 09, 2005 3:44 PM
> Subject: Re: [Springframework-developer] webflow: validators
>
> >> At the moment SWF does not have any direct binding & validation support
> >> of
> >> its own: it just uses the Spring binding and validation infrastructure
> >> (DataBinder, Errors, Validator). I don't think binding and validation is
> >> really a feature that we should build *into* SWF. Instead we need to
> >> integrate with existing solutions.
> >
> > I hear you. It's just that I really would like to see declarative
> > validation rules. Besides, a validator that would support this would
> > simply be a specialization of the Validator interface.
> >
> >>
> >> Could you elaborate on the "XWork validators" a bit?
> >>
> > This example says it all:
> >
> > <validators>
> > <field name="bar">
> > <field-validator type="required">
> > <message>You must enter a value for bar.</message>
> > </field-validator>
> > <field-validator type="int">
> > <param name="min">6</param>
> > <param name="max">10</param>
> > <message>bar must be between ${min} and ${max}, current
> > value is ${bar}.</message>
> > </field-validator>
> > </field>
> > <field name="date">
> > <field-validator type="date">
> > <param name="min">12/22/2002</param>
> > <param name="max">12/25/2002</param>
> > <message>The date must be between 12-22-2002 and
> > 12-25-2002.</message>
> > </field-validator>
> > </field>
> > <field name="foo">
> > <field-validator type="int">
> > <param name="min">0</param>
> > <param name="max">100</param>
> > <message key="foo.range">Could not find foo.range!</message>
> > </field-validator>
> > </field>
> > <validator type="expression">
> > <param name="expression">foo > bar</param>
> > <message>Foo must be greater than Bar. Foo = ${foo}, Bar =
> > ${bar}.</message>
> > </validator>
> > </validators>
> >
> >
> > -------------------------------------------------------
> > SF email is sponsored by - The IT Product Guide
> > Read honest & candid reviews on hundreds of IT Products from real users.
> > Discover which products truly live up to the hype. Start reading now.
> > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
> >
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
--
"If you want to be a different fish, you gotta jump out of the school."
-- Captain Beefheart
|