Author | Message |
---|---|
xytian
Posts: 70
|
Posted 23:21 May 09, 2013 |
I have same validation codes for user registration as in the springmvc example. The validation seems to work (if all fields supplied, there is new entry in the database, otherwise it returns to the registration page).
|
cysun
Posts: 2935
|
Posted 08:35 May 10, 2013 |
There's no way to tell exactly what went wrong based on what you described. Just read the sample code carefully and see if you missed anything. |
xytian
Posts: 70
|
Posted 02:37 May 11, 2013 |
It turns out that every time an error occurs, the registration form fields are populated with a new User object instead of using the binding results. In "GET" method: |
xytian
Posts: 70
|
Posted 15:18 May 11, 2013 |
I solved it! Odd enough, just change the name of ModelAttributes then it works fine: newuser -> user, newlawyer->lawyer. It doesn't like the word "new" |