The reason is because when a user input all the necessary fields I have one wrong instead of returning the empty page and form it returns all the values he inputted so he/she won't have to start afresh
Thank you Teddy for this serie. I am having a "Whitelabel Error Page" while testing the case where my fields are empty, I expected messages to be displayed on added p tags for the clubs-edit fragment. Any idea?
If you follow the tutorial carefully, you will not get any error. Try rewatching. I also used to have that error and it was mainly because of missing annotations.
Whati s the difference of objects Errors and BindingResult? They seem to serve the same purpose. I saw a code using Errors as a replacement for BindingResult
Exception :Failed to convert value of type 'null' to required type 'long' .Hey Teddy its giviveig this exception when i change saveClub functions parameter from Club to ClubDto. Here club-create is sending null value to id in ClubDto . how can i fix this please help
One of your forms is likely mismatched with the model. Check to make sure all the properties in the DTO are valid. You can also step thru with debugger and it will tell you where issue is.
10:10 I'm a bit confused as to why you added model.addAttribute() on the /clubs/new post view but not on the /clubs/{clubId}/edit view in 5:24?
The reason is because when a user input all the necessary fields I have one wrong instead of returning the empty page and form it returns all the values he inputted so he/she won't have to start afresh
I have the same confuse, And I did not add model though, it still work for me.
damn, was curious to know. Appreciate it man@@mostviewedtoks
why is the old data won't be deleted when i update the data?
Thank you Teddy for this serie. I am having a "Whitelabel Error Page" while testing the case where my fields are empty, I expected messages to be displayed on added p tags for the clubs-edit fragment. Any idea?
The same, what was the problem for you ?
If you follow the tutorial carefully, you will not get any error.
Try rewatching. I also used to have that error and it was mainly because of missing annotations.
Please mine is working fine but returning a blank message instead of the errors help!
I have the Whitelabel Error Page that is sent by Spring instead of returning back to the edit page. Is it the same on you side?
i have the same problem, when i try to create new club with blank fields, but it works when i try to edit club
also i copied code from author's github
I had the messages for edit but not create that I fixed by changing my ClubDto id data type from long to Long
Whati s the difference of objects Errors and BindingResult? They seem to serve the same purpose. I saw a code using Errors as a replacement for BindingResult
Exception :Failed to convert value of type 'null' to required type 'long' .Hey Teddy its giviveig this exception when i change saveClub functions parameter from Club to ClubDto. Here club-create is sending null value to id in ClubDto . how can i fix this please help
Difficult to fix without seeing code. Please post picture in discord and I will look at it.
@@TeddySmithDev Thanks For Quick Response i fixed it by just adding hidden id input field just like club-edit.html
@@santoshpoptani7756 you helped me a lot
@santoshpoptani7756 could share did you add the hidden input?
@@TeddySmithDev Could you share which Spring-Boot-Starter-Validation version did you use?
I did it. Ty(thank you)
I tried the same as you but BindingResult.hasErrors always return false ... help me.
One of your forms is likely mismatched with the model. Check to make sure all the properties in the DTO are valid. You can also step thru with debugger and it will tell you where issue is.