habuma / spring-in-action-5-samples

Home for example code from Spring in Action 5.
Apache License 2.0
1.21k stars 1.04k forks source link

[Ch 04] Validating Registration Form #77

Open rnaveen93 opened 4 years ago

rnaveen93 commented 4 years ago

I was working on adding validation to Registration.html. I added th.object, th.field. But the Model object received by Controller is null. Could you please assist.

I have included Registartion.html, RegistrationForm.java and RegistrationController.java

registration.txt RegistrationForm.txt RegistrationController.txt

Trace Output: 2020-04-18 14:26:43.206 TRACE 48956 --- [nio-8080-exec-9] o.s.web.servlet.DispatcherServlet : POST "/register", parameters={masked}, headers={masked} in DispatcherServlet 'dispatcherServlet' 2020-04-18 14:26:43.207 TRACE 48956 --- [nio-8080-exec-9] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to tacos.security.RegistrationController#ProcessRegistration(RegistrationForm, Errors, SessionStatus) 2020-04-18 14:26:43.208 TRACE 48956 --- [nio-8080-exec-9] o.s.w.m.support.InvocableHandlerMethod : Arguments: [] 2020-04-18 14:26:43.268 TRACE 48956 --- [nio-8080-exec-9] .w.s.m.m.a.ServletInvocableHandlerMethod : Arguments: [RegistrationForm(username=null, password=null, confirmpassword=null, fullname=null, street=null, city=null, state=null, zip=null, phone=null), org.springframework.validation.BeanPropertyBindingResult: 9 errors