You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Joachim Ansorg <ja...@ksi.gr> on 2007/11/06 10:04:18 UTC

Re: Validation Best Practices?

Tom,
I've read this thread with great interest.

Currently I'm thinking about the validation problem as well. I looked at 
springmodule's Bean validation framework.
(https://springmodules.dev.java.net/docs/reference/0.8/html/validation.html#beanValidator). 
Looks quite interesting to me.
Does somebody have any experience using it together with Struts 2?

Do you have any experience now using validators in seperate classes?
If yes, which validation framework did you choose and what is you 
opinion now after using this approach?

Thanks for any hints,
Joachim
> I think drools would be way overkill for simple validation.  Not only would
> there be a high learning curve, I don't think it would handle the most
> involved cases.  I really think we need to do Java by default.
>
> The reason I included a way to autofind the validation class is to mimic how
> the existing xml validation automatically works.  I'm OK with doing
> delegation to another validator in the validate() method of the action, I
> just thought it might be nice to have convention over explicit delegation,
> but I'm open to other ideas.
>
> I would definitely use another validation API under the hood.  My idea would
> be to have a standard set of convenience validation methods in the super
> class that defers to either commons validation or Spring's validation
> support.  I'd like the validation code to be as concise as possible, an API
> similar to Spring's valang might work--except in java code instead of a
> custom language.
>
> If others would find this kind of thing useful, I think it would be useful
> to create a googlecode project to begin a proof of concept.  Work through
> what the API would look like because I think it would be a great alternative
> to the validation framework that's in place now.  (And as I stated before, I
> would love to use this both at the UI level and at the business
> logic/component level)
> Tom
>   

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


Re: Validation Best Practices?

Posted by Tom Schneider <sc...@gmail.com>.
That looks like an interesting project.  There are a lot of things that I
like about what they are doing.  There are a lot of things that could be
handle that way.  My fear with making everything a seperate Rule class is
that some things cannot be encoded as a simple rule.  Somevalidation needs
too much information and requires too much external information.  This
framework would be great as something to build on top of though.  Thanks for
pointing it out.
Tom


Joachim Ansorg-3 wrote:
> 
> Tom,
> I've read this thread with great interest.
> 
> Currently I'm thinking about the validation problem as well. I looked at 
> springmodule's Bean validation framework.
> (https://springmodules.dev.java.net/docs/reference/0.8/html/validation.html#beanValidator). 
> Looks quite interesting to me.
> Does somebody have any experience using it together with Struts 2?
> 
> Do you have any experience now using validators in seperate classes?
> If yes, which validation framework did you choose and what is you 
> opinion now after using this approach?
> 
> Thanks for any hints,
> Joachim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Validation-Best-Practices--tf4685400.html#a13606501
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