wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Vara <bashfl...@gmail.com>
Subject Re: Any "mature" work on integrating Hibernate Validator with Wicket?
Date Mon, 05 Apr 2010 20:52:46 GMT
Hi David,

I'm the author of the first article that you linked to:
http://carinae.net/tag/hibernate-validator/

<http://carinae.net/2009/12/integration-of-jsr-303-bean-validation-standard-and-wicket-1-4/>Basically,
you hardly need more than the two provided validators (for property
validation on field input, and full bean validation on form input). I added
some extra code to integrate it with Spring and to centralize the locale,
but if you don't need it, you can easily use only those validators without
anything else.

The way I see it, there is no code in wicketstuff because it is quite simple
to integrate jsr303 and wicket, so picking the code from my or others blog,
and maybe tweaking it a little for your needs is probably all you need.



On Mon, Apr 5, 2010 at 9:39 PM, Ben Tilford <bentilford@gmail.com> wrote:

> So far this is what I've got. Doesn't do anything with groups or the more
> advanced stuff but this may be all it takes.
>
> public class BeanComponentValidator<T> extends AbstractValidator<T> {
>
>
>    public BeanComponentValidator() {
>        super();
>    }
>
>
>    @Override
>    protected void onValidate(IValidatable<T> validatable) {
>        for(ConstraintViolation<T> violation :
> validate(validatable.getValue())) {
>            validatable.error(new
> ValidationError().addMessageKey(violation.getMessage()));
>        }
>
>    }
>
>    Set<ConstraintViolation<T>> validate(T value) {
>        Validator validator =
>
>  Validation.buildDefaultValidatorFactory().getValidator();//this may only
> be
> working because I'm using Spring 3.0.2 and Hibernate 3.5 I don't know for
> sure.
>        return validator.validate(value);
>    }
> }
>
>
> On Mon, Apr 5, 2010 at 12:15 PM, Martin Makundi <
> martin.makundi@koodaripalvelut.com> wrote:
>
> > Hi!
> >
> > It's quite easy to add trivial min/max/required validators using (any)
> > helper method. Maybe bindgen project would be closest to this.. it's
> > already working with annotations, it could perhaps parse also
> > annotations of property target objects.
> >
> > **
> > Martin
> >
> > 2010/4/5 David Chang <david_q_zhang@yahoo.com>:
> > > Using Hibernate Validator may bring a few good things:
> > >
> > > 1. On the data end, it helps to improve data, performance, etc. Also
> the
> > annotation you write on domain objects get translated into database
> creation
> > and objects save/update. You can find more on in this area. Obviously,
> this
> > has nothing to do with wicket.
> > >
> > > 2. Regarding the web tier, it is often needed to write validation rules
> > such as not null or the maximum chars in an input field being less than
> 10.
> > In pure wicket, you have to add many validation rules yourself manually
> for
> > each field. Why should I do so second time in wicket if I can explicitly
> > specify them on domain objects via Hibernate Validator (or Bean
> Validation,
> > JSR 303, now official)? I hope to see wicket can take adavantage of bean
> > validation to let us code faster and have more maintainable code.
> > >
> > > Please feel free to comment I am wrong.
> > >
> > > Best.
> > >
> > >
> > >
> > >
> > >
> > > --- On Mon, 4/5/10, Martin Makundi <martin.makundi@koodaripalvelut.com
> >
> > wrote:
> > >
> > >> From: Martin Makundi <martin.makundi@koodaripalvelut.com>
> > >> Subject: Re: Any "mature" work on integrating Hibernate Validator with
> > Wicket?
> > >> To: users@wicket.apache.org
> > >> Date: Monday, April 5, 2010, 11:31 AM
> > >> Do you have any user stories on the
> > >> topic? It would be useful to
> > >> evaluate how interesting the use case is. Me myself I
> > >> cannot immagine
> > >> anything "useful" could come out of hibernate validators,
> > >> only
> > >> something very trivial. Could be wrong, thoug.
> > >>
> > >> **
> > >> Martin
> > >>
> > >> 2010/4/5 David Chang <david_q_zhang@yahoo.com>:
> > >> >
> > >> > thanks for chiming in. sorry if i was not clear in
> > >> prevoius posts.
> > >> >
> > >> > i would like to hear comments whether it is worthy to
> > >> explore or any benefits. i also would like to know whether
> > >> there is more "mature" work since i only found experimental
> > >> work. i am unable to find anything aobut it on wicketstuff.
> > >> >
> > >> > regards.
> > >> >
> > >> >
> > >> > --- On Mon, 4/5/10, Igor Vaynberg <igor.vaynberg@gmail.com>
> > >> wrote:
> > >> >
> > >> >> From: Igor Vaynberg <igor.vaynberg@gmail.com>
> > >> >> Subject: Re: Any "mature" work on integrating
> > >> Hibernate Validator with Wicket?
> > >> >> To: users@wicket.apache.org
> > >> >> Date: Monday, April 5, 2010, 11:21 AM
> > >> >> you have answered your own question
> > >> >> twice, why does anyone else need to reply?
> > >> >>
> > >> >> -igor
> > >> >>
> > >> >> On Mon, Apr 5, 2010 at 8:01 AM, David Chang <
> david_q_zhang@yahoo.com
> > >
> > >> >> wrote:
> > >> >> >
> > >> >> > Hi folks, I feel a bit puzzled about not
> > >> getting any
> > >> >> response on this topic. I have to say that I am
> > >> new in
> > >> >> Wicket. If this a bad or wrong question or if this
> > >> is
> > >> >> something not worthy to explore, please feel free
> > >> to let me
> > >> >> know.
> > >> >> >
> > >> >> > Thanks for any input!
> > >> >> >
> > >> >> >
> > >> >> > --- On Sun, 4/4/10, David Chang <david_q_zhang@yahoo.com>
> > >> >> wrote:
> > >> >> >
> > >> >> >> From: David Chang <david_q_zhang@yahoo.com>
> > >> >> >> Subject: Re: Any "mature" work on
> > >> integrating
> > >> >> Hibernate Validator with Wicket?
> > >> >> >> To: users@wicket.apache.org
> > >> >> >> Date: Sunday, April 4, 2010, 11:31 PM
> > >> >> >> Found another related work.
> > >> >> >>
> > >> >> >>
> > http://42lines.net/content/integrating-hibernate-validator-and-wicket
> > >> >> >>
> > >> >> >> Any comment or pointers regarding
> > >> relatively
> > >> >> "mature" work
> > >> >> >> in this regard?
> > >> >> >>
> > >> >> >> Regards.
> > >> >> >>
> > >> >> >>
> > >> >> >> --- On Sat, 4/3/10, David Chang <david_q_zhang@yahoo.com>
> > >> >> >> wrote:
> > >> >> >>
> > >> >> >> > From: David Chang <david_q_zhang@yahoo.com>
> > >> >> >> > Subject: Any "mature" work on
> > >> integrating
> > >> >> Hibernate
> > >> >> >> Validator with Wicket?
> > >> >> >> > To: users@wicket.apache.org
> > >> >> >> > Date: Saturday, April 3, 2010, 1:45
> > >> PM
> > >> >> >> >
> > >> >> >> > Is there any "mature" work on
> > >> integrating
> > >> >> Hibernate
> > >> >> >> > Validator with Wicket?
> > >> >> >> >
> > >> >> >> > I am unable to find any at
> > >> wicketstuff.
> > >> >> Googled and
> > >> >> >> found
> > >> >> >> > this work is interesting.
> > >> >> >> >
> > >> >> >> > http://carinae.net/tag/hibernate-validator/
> > >> >> >> >
> > >> >> >> > Any pointers?
> > >> >> >> >
> > >> >> >> > Any comment?
> > >> >> >> >
> > >> >> >> > Thanks and Happy Easter!
> > >> >> >> >
> > >> >> >> >
> > >> >> >> >
> > >> >> >> >
> > >> >> >> >
> > >> >> >>
> > >> >>
> > >> ---------------------------------------------------------------------
> > >> >> >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> >> >> > For additional commands, e-mail: users-help@wicket.apache.org
> > >> >> >> >
> > >> >> >> >
> > >> >> >>
> > >> >> >>
> > >> >> >>
> > >> >> >>
> > >> >> >>
> > >> >>
> > >> ---------------------------------------------------------------------
> > >> >> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> >> >> For additional commands, e-mail: users-help@wicket.apache.org
> > >> >> >>
> > >> >> >>
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >> >
> > >> >>
> > >> ---------------------------------------------------------------------
> > >> >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> >> > For additional commands, e-mail: users-help@wicket.apache.org
> > >> >> >
> > >> >> >
> > >> >>
> > >> >>
> > >> ---------------------------------------------------------------------
> > >> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> >> For additional commands, e-mail: users-help@wicket.apache.org
> > >> >>
> > >> >>
> > >> >
> > >> >
> > >> >
> > >> >
> > >> >
> > >> ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> > For additional commands, e-mail: users-help@wicket.apache.org
> > >> >
> > >> >
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > >> For additional commands, e-mail: users-help@wicket.apache.org
> > >>
> > >>
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > > For additional commands, e-mail: users-help@wicket.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message