You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by doahh <ga...@prodia.co.uk> on 2010/01/15 16:52:51 UTC

How to do programatic validation?

I have a Flex app that is sending data to the server and I would like to
validate the Objects being passed on the server side. The Flex app passes
the information over an AMF channel and so it does not go through the
Struts2 framework.

So far, I have found classes such as:

com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator

but I get lost on what happens when I should call:

stringLengthFieldValidator.validate(myObject);

as it doesn't return anything and needs a non-null ValidatorContext - which
I don't know how to setup correctly.

Can anyone provide a link or advice on how to do this please?

-- 
View this message in context: http://old.nabble.com/How-to-do-programatic-validation--tp27179164p27179164.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: How to do programatic validation?

Posted by Wes Wannemacher <we...@wantii.com>.
D'oh! I should have checked first :)

-Wes

On Fri, Jan 15, 2010 at 1:46 PM, Greg Lindholm <gr...@gmail.com> wrote:
> Hibernate Validator 4.0 [1] is the RI for JSR 303 but Oval [2] does
> look very cool.
>
> [1] https://www.hibernate.org/459.html
> [2] http://oval.sourceforge.net/
>
> On Fri, Jan 15, 2010 at 12:37 PM, Wes Wannemacher <we...@wantii.com> wrote:
>> Before you tie yourself to commons-validator, take a look at Oval. I
>> could be wrong, but I think there is a bean validation JSR and Oval is
>> the reference implementation (or at least it is JSR compatible).
>>
>> -Wes
>>
>> On Fri, Jan 15, 2010 at 11:21 AM, doahh <ga...@prodia.co.uk> wrote:
>>>
>>> Don't worry about this. It looks like the commons-validator will be fine and
>>> I think thats what the struts2 framework uses underneath anyway.
>>>
>>>
>>>
>>>
>>> doahh wrote:
>>>>
>>>> I have a Flex app that is sending data to the server and I would like to
>>>> validate the Objects being passed on the server side. The Flex app passes
>>>> the information over an AMF channel and so it does not go through the
>>>> Struts2 framework.
>>>>
>>>> So far, I have found classes such as:
>>>>
>>>> com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator
>>>>
>>>> but I get lost on what happens when I should call:
>>>>
>>>> stringLengthFieldValidator.validate(myObject);
>>>>
>>>> as it doesn't return anything and needs a non-null ValidatorContext -
>>>> which I don't know how to setup correctly.
>>>>
>>>> Can anyone provide a link or advice on how to do this please?
>>>>
>>>>
>>>
>>> --
>>> View this message in context: http://old.nabble.com/How-to-do-programatic-validation--tp27179164p27179568.html
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>>
>> --
>> Wes Wannemacher
>>
>> Head Engineer, WanTii, Inc.
>> Need Training? Struts, Spring, Maven, Tomcat...
>> Ask me for a quote!
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: How to do programatic validation?

Posted by Greg Lindholm <gr...@gmail.com>.
Hibernate Validator 4.0 [1] is the RI for JSR 303 but Oval [2] does
look very cool.

[1] https://www.hibernate.org/459.html
[2] http://oval.sourceforge.net/

On Fri, Jan 15, 2010 at 12:37 PM, Wes Wannemacher <we...@wantii.com> wrote:
> Before you tie yourself to commons-validator, take a look at Oval. I
> could be wrong, but I think there is a bean validation JSR and Oval is
> the reference implementation (or at least it is JSR compatible).
>
> -Wes
>
> On Fri, Jan 15, 2010 at 11:21 AM, doahh <ga...@prodia.co.uk> wrote:
>>
>> Don't worry about this. It looks like the commons-validator will be fine and
>> I think thats what the struts2 framework uses underneath anyway.
>>
>>
>>
>>
>> doahh wrote:
>>>
>>> I have a Flex app that is sending data to the server and I would like to
>>> validate the Objects being passed on the server side. The Flex app passes
>>> the information over an AMF channel and so it does not go through the
>>> Struts2 framework.
>>>
>>> So far, I have found classes such as:
>>>
>>> com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator
>>>
>>> but I get lost on what happens when I should call:
>>>
>>> stringLengthFieldValidator.validate(myObject);
>>>
>>> as it doesn't return anything and needs a non-null ValidatorContext -
>>> which I don't know how to setup correctly.
>>>
>>> Can anyone provide a link or advice on how to do this please?
>>>
>>>
>>
>> --
>> View this message in context: http://old.nabble.com/How-to-do-programatic-validation--tp27179164p27179568.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
>
> --
> Wes Wannemacher
>
> Head Engineer, WanTii, Inc.
> Need Training? Struts, Spring, Maven, Tomcat...
> Ask me for a quote!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: How to do programatic validation?

Posted by Wes Wannemacher <we...@wantii.com>.
Before you tie yourself to commons-validator, take a look at Oval. I
could be wrong, but I think there is a bean validation JSR and Oval is
the reference implementation (or at least it is JSR compatible).

-Wes

On Fri, Jan 15, 2010 at 11:21 AM, doahh <ga...@prodia.co.uk> wrote:
>
> Don't worry about this. It looks like the commons-validator will be fine and
> I think thats what the struts2 framework uses underneath anyway.
>
>
>
>
> doahh wrote:
>>
>> I have a Flex app that is sending data to the server and I would like to
>> validate the Objects being passed on the server side. The Flex app passes
>> the information over an AMF channel and so it does not go through the
>> Struts2 framework.
>>
>> So far, I have found classes such as:
>>
>> com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator
>>
>> but I get lost on what happens when I should call:
>>
>> stringLengthFieldValidator.validate(myObject);
>>
>> as it doesn't return anything and needs a non-null ValidatorContext -
>> which I don't know how to setup correctly.
>>
>> Can anyone provide a link or advice on how to do this please?
>>
>>
>
> --
> View this message in context: http://old.nabble.com/How-to-do-programatic-validation--tp27179164p27179568.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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


Re: How to do programatic validation?

Posted by doahh <ga...@prodia.co.uk>.
Don't worry about this. It looks like the commons-validator will be fine and
I think thats what the struts2 framework uses underneath anyway.




doahh wrote:
> 
> I have a Flex app that is sending data to the server and I would like to
> validate the Objects being passed on the server side. The Flex app passes
> the information over an AMF channel and so it does not go through the
> Struts2 framework.
> 
> So far, I have found classes such as:
> 
> com.opensymphony.xwork2.validator.validators.StringLengthFieldValidator
> 
> but I get lost on what happens when I should call:
> 
> stringLengthFieldValidator.validate(myObject);
> 
> as it doesn't return anything and needs a non-null ValidatorContext -
> which I don't know how to setup correctly.
> 
> Can anyone provide a link or advice on how to do this please?
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-do-programatic-validation--tp27179164p27179568.html
Sent from the Struts - User mailing list archive at Nabble.com.


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