why do you use an exception for user already exits?Don`t you think that
return true/false, could be better?
i said that, because if the application start growing, you will have lot of
exceptions class.
thanks,
NM


On Wed, Sep 30, 2009 at 4:43 PM, Paul Huang <paulhuan...@gmail.com> wrote:

>
>
>
> igor.vaynberg wrote:
> >
> > form {
> >   onsubmit() {
> >        try {
> >           users.persist(getmodelobject());
> >        } catch (usernamealreadyexistsexception e) {
> >           error("error.username.exists");
> >        }
> >    }
> > }
> >
> > -igor
> >
>
> Thanks, it works like a charm. I did not  know I could show an error
> message
> by calling "Component.error" and then use a filter to catch all error
> messages targeting a specific FormComponent.
>
>
> --
> View this message in context:
> http://www.nabble.com/User-name-validation---how-to-check-database-to-find-if-a-name-has--already-been-taken--tp25614625p25682499.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to