Thanks Igor.Always is good another point of view.
NM
On Wed, Sep 30, 2009 at 5:14 PM, Igor Vaynberg igor.vaynb...@gmail.comwrote:
actually you got it completely wrong. especially as your project, and
the number of devs who work on it, grows exceptions are a much more
scalable way of handling
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
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:
The AbstractValidator approach is fine, or you can do it the shorter
way the Igor showed.
Either way, when the page that has the username is submitted, you're
going to have to write that record to the database, even if you don't
have all the info. The way you wrote the question, I presume
actually you got it completely wrong. especially as your project, and
the number of devs who work on it, grows exceptions are a much more
scalable way of handling errors.
1) the compiler tells you exactly what the exceptions are right off the bat
2) exception class name gives you a clue as to
The AbstractValidator approach is fine, or you can do it the shorter
way the Igor showed.
Either way, when the page that has the username is submitted, you're
going to have to write that record to the database, even if you don't
have all the info. The way you wrote the question, I presume you
Hello,
I would like to get your suggestion about how to validate a user name input
by checking if the name has already been taken (exists in the back-end
database); and how to show feedback messages right next to the input field
if it has.
Typically, when a user registers to a website, he needs
I think you are overcomplicating things. Validate the users input, if
two users want the same name within 1 second of each request you
probably have bigger problems to deal with. Anyhow, when submit is
called, if you get a nonunique exception. Catch in dao/service and
throw an exception wicket
Ryan Gravener-3 wrote:
I think you are overcomplicating things. Validate the users input, if
two users want the same name within 1 second of each request you
probably have bigger problems to deal with.
So you think my current solution (extending AbstractValidator) is OK?
But I still
form {
onsubmit() {
try {
users.persist(getmodelobject());
} catch (usernamealreadyexistsexception e) {
error(error.username.exists);
}
}
}
-igor
On Fri, Sep 25, 2009 at 9:05 AM, Ryan Gravener r...@ryangravener.com wrote:
I think you are
10 matches
Mail list logo