Server Side Form Validation | Spring MVC | Spring Boot Tutorial

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • Server Side Form Validation | Spring MVC | Spring Boot Tutorial
    In this video we are going to learn how to validate form in spring mvc controller step by step in hindi.
    we will use thymeleaf as view technology in and spring boot.
    Download Source Code: learncodewithd...
    Spring-boot full playlist: • Spring Boot Tutorial i...
    Spring MVC playlist: • Spring MVC Tutorial St...
    Spring framework playlist: • Spring Framework Tutor...
    MySQL in one video: • Learn MySQL in one vid...
    Telegram Link for Doubt: t.me/learncode...
    Important Videos:
    ➡️React JS with Project: • 🔥 🔥 Complete React Js ...
    ➡️Learn JDBC in one video: • JDBC Crash Course in 1...
    ➡️Learn Python in One Video: • Learn Python in One Vi...
    ➡️Learn HTML in one video: • Jquery in one video in...
    ➡️Learn HTML form in one video: • Jquery in one video in...
    ➡️Learn JavaScript in one videos: • Learn JavaScript in O...
    ➡️Learn Form Validation using javascript and jquery: • Form Validation using ...
    ➡️Learn CSS in one video: • Jquery in one video in...
    ➡️Jquery in one video: • Jquery in one video in...
    ➡️Kotlin is one video: • Kotlin | Learn Kotlin ...
    ➡️Complete Python Project - CZcams downloader in one video: • Jquery in one video in...
    Important Playlist:
    ➡️Spring Boot Tutorial with Project : • Spring Boot Tutorial i...
    ➡️Spring MVC Tutorial: • Spring MVC Tutorial St...
    ➡️Complete Spring Framework Tutorial: • Spring Framework Tutor...
    ➡️Hibernate Tutorials: • Hibernate Tutorial for...
    ➡️E-Commerce Project using Java: • E-Commerce Project usi...
    ➡️AWS Free Java Hosting Playlist: • AWS Hosting Tutorial |...
    ➡️Hibernate Tutorial Playlist: • Hibernate Tutorial for...
    ➡️Learn Technology in One Vides: • Learn in one video : C...
    ➡️Programming Tips for Programmers: • Coding Tips and Discus...
    ➡️Complete Python for Beginners: • Complete Python Tutori...
    ➡️Important Python Projects: • Python Projects in Hindi
    ➡️Complete Servlet & JSP : • Servlet and Jsp (Serve...
    ➡️Complete JDBC ( Java Database Connectivity) : • JDBC(Java Database Con...
    ➡️Complete Java Project : TechBlog: • Full Java Advance Pro...
    ➡️Java Swing Projects: • Java Projects for begi...
    ➡️Java Core Concepts: • Java Core Tutorial
    ➡️Kya aap Jante hai Series: • kya app jante hai : s...
    Important Links:
    👉Official Website (Source Code): learncodewithd...
    👉Telegram Discussion Group: t.me/learncode...
    👉Follow me on Instagram: / durgesh_k_t
    👉Follow on Facebook / learncodewithdurgesh
    Gear that I use:
    Gears that I Use:
    Lenovo Ideapad S145 AMD Ryzen 5 15.6
    amzn.to/33Vvxu2
    Mic for Recording
    amzn.to/305hgtr
    amzn.to/2EyFMfa
    Disclaimer:
    All videos are for educational purposes and use them wisely. Any video may have a slight mistake, please take decisions based on your research. This video is not forcing anything on you.

Komentáře • 171

  • @user-xk4jh3lr7n
    @user-xk4jh3lr7n Před 10 měsíci +13

    Hey guys if you're facing some validation issues, just use spring boot starter validation dependency ONLY instead of using validation API and hibernate validator dependencies. then update your maven project and rerun the application. It worked for me!!!

    • @diptidesai7399
      @diptidesai7399 Před 9 měsíci +1

      Thank you

    • @mohitgupta7841
      @mohitgupta7841 Před 6 měsíci

      Thanks

    • @Spatil1500
      @Spatil1500 Před 5 měsíci

      Thanks

    • @YashSingh-xs5yj
      @YashSingh-xs5yj Před 2 měsíci

      For me that spring bean and hibernate validator dependencies were working fine, but this dependency is better and easy to understand, thank you

    • @yashgupta7220
      @yashgupta7220 Před 2 měsíci

      @@YashSingh-xs5yj It's not working for me

  • @VivekRaj-ft6zh
    @VivekRaj-ft6zh Před 4 lety +9

    I have been following your videos on spring. They are really good. All thanks to you.

    • @User-ow7rn
      @User-ow7rn Před 3 lety

      sir apne form page me loginData ka username and email direct kese access kiya,wo to private h na loginData class me

  • @PrinceKumar-xn4dy
    @PrinceKumar-xn4dy Před 4 lety +3

    Thank you sir yotube pe apke jaysa koi nahi sikhata ... you are the best. Sir bas aysa hi content dalte jaea subscriber apne aap badhte chala jaega... mere sare dost jo software field me hai apko subscribe kiye hue hai...

  • @159saur
    @159saur Před 11 dny

    After a decades I felt like I will learn the I can learn it as your wonderful Spring videos helped to learn lots of concept, which is much apricated because nobody is able to share similar content but since it's almost 3 years old in this time duration Thymleaf people made changes which get me stuck again it's being a week I am stuck on this video trying to find the solution but feels like I have no where to go :(

  • @ishusuryavanshi8435
    @ishusuryavanshi8435 Před 4 lety +8

    Sir payment integration bhi batana sir please.....sir

  • @ishusuryavanshi8435
    @ishusuryavanshi8435 Před 4 lety +1

    Sir aap gazab ho sir

  • @Satyaprakash-xs4jx
    @Satyaprakash-xs4jx Před 3 lety +4

    Hibernate Validator is not working in Spring Boot...What to do?

  • @ramjas5351
    @ramjas5351 Před 11 měsíci +2

    Javax.validation is changed to jakarta.validation

  • @prasadrao5351
    @prasadrao5351 Před 2 lety

    This was very well Explained. Ty

  • @ramisetty3779
    @ramisetty3779 Před 4 lety +1

    Bro provide subtitles it's very helpful to us

  • @nimisharaj8501
    @nimisharaj8501 Před 4 měsíci +1

    I am getting an error
    Exception evaluating SpringEL expression: "#fields.hasErrors('userName') ? 'is-invalid': ''"

  • @spnarayanrao
    @spnarayanrao Před 3 lety +1

    Thanks for video. Please create videos on more complicated server side validation on MVC using JSP and validations on Rest API

    • @User-ow7rn
      @User-ow7rn Před 3 lety

      sir apne form page me loginData ka username and email direct kese access kiya,wo to private h na loginData class me

    • @sanjuktamozumdar2471
      @sanjuktamozumdar2471 Před rokem

      @@User-ow7rn Using Getter and Setter

  • @nikhilgehlot5332
    @nikhilgehlot5332 Před 3 lety +3

    After applying validation blanks values are getting accepted no errors are coming in bindingresult's object

    • @ShubhamSingh-og6cj
      @ShubhamSingh-og6cj Před 3 lety

      m also facing this issue , any luck ?

    • @User-ow7rn
      @User-ow7rn Před 3 lety

      sir apne form page me loginData ka username and email direct kese access kiya,wo to private h na loginData class me

    • @nidhijha1137
      @nidhijha1137 Před 3 lety

      Did you got the answer?

    • @nurzamalislam177
      @nurzamalislam177 Před 2 lety

      same problem...any solution? @Durgesh bro

    • @Abdulkhaliq-sx8ft
      @Abdulkhaliq-sx8ft Před 2 lety

      I am also facing the same problem.

  • @mohdyaseenkhan9147
    @mohdyaseenkhan9147 Před rokem

    Well explaination

  • @devpanda7084
    @devpanda7084 Před 2 lety

    Superb video . Ek cheez confirm karni thi , isme ham alag alag code likh rhe hain email aur username validation ka html me using thymeleaf. Isko generic karne ke liye ham fragment bana sakte hain jisme input me parameter daal denge email ya username aur wo FRAGMENT yaha include kar lein . Code generic ho jaayega poore project ke liye hamara . Ab jisko b call karna hai wo us fragment ko include karle

  • @pratikkharche3247
    @pratikkharche3247 Před rokem +1

    I'm unable to validated the input data I also added hibernate related dependency also added @Valid annotation, clean and rebuild the project for 2nd try also tried to ad the jar files in project structures but still not able to run validation. After @Valid still my programme is taking null data in db

    • @adityarathor5300
      @adityarathor5300 Před rokem

      did you find any further solution on this?

    • @Iamdev55
      @Iamdev55 Před 11 měsíci

      If u using newer version of Java EE more than Java EE 7 then import jakarta validation it will work

  • @dhananjaypundir5992
    @dhananjaypundir5992 Před 2 lety +2

    i am using jdk 11 and spring boot 2.6.4 @Size(max = 5, message = "A persons name must not be longer than 5 characters.") annotation is not working .Is there any problem.
    i tried with jdk 14 also but problem remains same.

  • @anweshabhisek7549
    @anweshabhisek7549 Před 3 lety

    Thanks a lot sir

  • @pradeepk2864
    @pradeepk2864 Před rokem +1

    watching in 04-08-2023 , we have to make some modifications in the code, then only it works

  • @malkaaabbaayaadaa3889
    @malkaaabbaayaadaa3889 Před 2 lety +1

    Thank you Sir, I've been following your tutorial and very awesome and helpful; but I've got a question about how to validate ManyToOne r/s, for example Trainee and course, one trainee can take many course and if the registered trainee has already taken the course, the system rejects it while registration using course_id and trainee_id (because they are trying to take the same course twice),..the message displayed is:"this trainee has already taken this course". Could you kindly help on this problem using Springboot Validator?

  • @nannuuuuu
    @nannuuuuu Před 2 lety

    thank you so much😭

  • @aditikaushik5147
    @aditikaushik5147 Před 2 lety

    liked the content

  • @shashanknaag4910
    @shashanknaag4910 Před 2 lety

    Thanks Sir

  • @vinitraj6268
    @vinitraj6268 Před rokem +2

    those who are not getting error msg after submitting unacceptable values
    just use this dependency only
    org.springframework.boot
    spring-boot-starter-validation

    And, import these packages
    jakarta.validation.Valid
    jakarta.validation.constraints.Size
    jakarta.validation.constraints.NotBlank
    for @Valid, @Size and @NotBlank annotations...

  • @DreamQuestGamer
    @DreamQuestGamer Před 2 lety +2

    Sir can you explain the purpose of sending empty object to the form? Cause even if we do not send it it is working. I am new, so I am having doubt.
    Another one in MVC we was using Model to send data to a page along with @moduleattribute..but here we are not..and it is working how and why?

    • @mahimatolani813
      @mahimatolani813 Před 9 měsíci

      As much as I understood model attribute we used to send the view data to controller altogether instead of using RequestParm annotation and taking view values one by one and if you dont send empty object then we have used th:object =loginData that means we have sent the object which is being used here and will be used if we dont send we will get error

  • @User-ow7rn
    @User-ow7rn Před 3 lety +2

    at 18:47 pe age email and userName null rha to usme to exception aa rha h

  • @shahzebjamil5297
    @shahzebjamil5297 Před 24 dny

    import jakarta instead of javax in new versions to show result errors in console

  • @ashwinkothari4411
    @ashwinkothari4411 Před 3 lety

    Facing issue while creating spring boot project in eclipse and select spring starter project, it shows error SunCertPathBuilderException : unable to valid certification path to requested target...plz help me on this...

  • @shefali.v50
    @shefali.v50 Před 3 měsíci

    Around timetsamp @50:00, Anyone who can explain me what validation was removed from noValidation tag in html??
    EDIT : Understood, their was HTML validation also getting displayed which was removed with noValidation.

  • @ishusuryavanshi8435
    @ishusuryavanshi8435 Před 4 lety

    Nice sir

  • @Krushil_Virja
    @Krushil_Virja Před 10 měsíci

    please make video on validation using java scripts

  • @rohitgaikwad4108
    @rohitgaikwad4108 Před 2 lety

    Hi sir.. please help for how i apply validation for jsp page..means instead of th: tag i want to apply form: tag..so how to do using form tag . please help

  • @ravishankarsingh7512
    @ravishankarsingh7512 Před 3 lety

    If data is not mandatory then we want to use regex then how we can use....if data there then check pattern .. otherwise no error...how can we do?

  • @shubhamrasal388
    @shubhamrasal388 Před 2 měsíci

    Those are getting the error Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: "#fields.hasError('username')?'is-invalid':''" (template: "form" - line 21, col 82) just correct your method name its (hasErrors) not hasError

  • @waseelmufti5203
    @waseelmufti5203 Před rokem

    latest update: javax dependencies are now moved to jakarta package. I tried javax validations but they are not working, when I replace it with jakarta now the validation working fine.

  • @sharuk3545
    @sharuk3545 Před 2 lety

    thnk u sir

  • @abhisheksinghkushwah6689

    Plz Make video on Design Pattern It is my request

  • @mishukids
    @mishukids Před 3 lety

    Hi sir ,thanks to this video,sir when will u make jursy projects

  • @nikhilsir786
    @nikhilsir786 Před rokem

    Hi Durgesh I have added Hibernate validator dependency but not showing binding result errors on console....Can you help me...

    • @nikhilsir786
      @nikhilsir786 Před rokem

      Not able to proceed further in the video as validator is not working but every annotation is working fine even dependency is added successfully. Need your expertise.

  • @pujac2241
    @pujac2241 Před rokem

    I cant understand sir , where the Rest api series end , where thymeleaf end , and this is of mvc

  • @priyankaavhad3218
    @priyankaavhad3218 Před rokem

    After adding @ valid annotation I m getting error jakarta. ServletException: circular view path[form]... How to solve plz reply

    • @akadeadahot7067
      @akadeadahot7067 Před rokem

      you might have entered wrong path in form action or any thing wrong in handling controller check once

  • @faeemazazbhanej7237
    @faeemazazbhanej7237 Před 2 lety +1

    Size annotation is not work. Only NotNull annotation is worked .

  • @TarunSingh-je9my
    @TarunSingh-je9my Před 3 lety

    Sir can you upload videos of Springboot with Angular JS

  • @rakeshkumar-gz5fr
    @rakeshkumar-gz5fr Před 3 lety

    Hi
    Can you please create a course for Spring Security module. Where we can design a custom login page with user registeration, activation link,forget password and remember me options enabled on login page. Also this custom login page can be integrated with third party identity providers like okta, or Azure Ad for aforementioned functionalities like Authentication, Forget Password, User Registeration.. Thanks

  • @GoogleUser-vt7zl
    @GoogleUser-vt7zl Před 3 lety

    sir why you remove thymeleaf videos from playlist of spring boot

  • @karangupta5833
    @karangupta5833 Před 3 lety

    Sir please make some crud and login security on jsp page using spring boot please sir i humble request you bcz its about my job

  • @intakhabalam4469
    @intakhabalam4469 Před 3 lety

    Sir Please make payment integration lecture videos.....................................................................

  • @devansh8401
    @devansh8401 Před 3 lety

    sir, please tell us how to fix the chatterbot dependencies error

  • @devanshmittal3604
    @devanshmittal3604 Před rokem

    Hey I'm getting details by th:text=" ${loginData}" but it shows error for th:text=" ${loginData.userName}"

    • @ritikrstgi
      @ritikrstgi Před 6 měsíci

      Have you resolve this issue?

    • @dev12497
      @dev12497 Před 6 měsíci

      Yes you should check your name given to the input value

  • @User-ow7rn
    @User-ow7rn Před 3 lety

    are sir,hmare me form page execute krne pe username or email not found or may be null exception error aa rha hai,reply to kro

    • @nitintyagi1451
      @nitintyagi1451 Před rokem

      the word "L" in logindata is small.use it lowercase and then let me know

  • @PANKAJSharma-qb2zk
    @PANKAJSharma-qb2zk Před 3 lety

    sir why my pom.xml show error when add bean validation Api means javax.validation dependency

  • @rakshir279
    @rakshir279 Před 2 lety +1

    for some reason validation is not working...:(

  • @ash143aish
    @ash143aish Před 3 lety

    hi sir i am getting false as value for check box even i ticked it...???

    • @User-ow7rn
      @User-ow7rn Před 3 lety

      sir apne form page me loginData ka username and email direct kese access kiya,wo to private h na loginData class me

    • @nitintyagi1451
      @nitintyagi1451 Před rokem

      @@User-ow7rn bro Logindata ka object bnake processForm method m

    • @juhisrivastava7506
      @juhisrivastava7506 Před 3 měsíci

      hey!! I am getting the same problem....did you find the answer? If so please help

  • @swatishirsath
    @swatishirsath Před rokem

    how to do this login page in jsp

  • @akadeadahot7067
    @akadeadahot7067 Před rokem +1

    and form.html will be as following


    Username







    Email address









    Check me out

    Submit

  • @yuvrajsinghcme1143
    @yuvrajsinghcme1143 Před rokem

    Did anyone getting error Property or field userName cannot be found NULL??? how to solve it?

    • @tuhinjana9853
      @tuhinjana9853 Před 11 měsíci

      Hey do you get the solution?

    • @sscode3809
      @sscode3809 Před 11 měsíci

      ​@@tuhinjana9853same error how to solve it do you know

    • @mahimatolani813
      @mahimatolani813 Před 9 měsíci

      Please note whatever input tag name attribute value is should match with our Entity field value else it will give error. Happened with me too

    • @yuvrajsinghcme1143
      @yuvrajsinghcme1143 Před 9 měsíci

      ThankYou @@mahimatolani813

    • @avinashkumar8466
      @avinashkumar8466 Před 6 měsíci

      @@mahimatolani813 bro i cross checkattribute value but still username value is null

  • @ankitsingh791
    @ankitsingh791 Před rokem

    Emmet ka link share kr do please

  • @nishanthedaoo8937
    @nishanthedaoo8937 Před 3 lety +1

    Sir source code kaha se milega is video ka?

  • @User-ow7rn
    @User-ow7rn Před 3 lety

    sir apne form page me loginData ka username and email direct kese access kiya,wo to private h na loginData class me

  • @kartikeymaurya1868
    @kartikeymaurya1868 Před rokem

    Sir I am writing html:5 then press it is not working

  • @shubhamnigam14
    @shubhamnigam14 Před 4 lety

    Nice video

    • @User-ow7rn
      @User-ow7rn Před 3 lety

      sir apne form page me loginData ka username and email direct kese access kiya,wo to private h na loginData class me

  • @PoorviSinghai
    @PoorviSinghai Před rokem

    Thank you so much Sir for these videos. But I am not able to get errors in result. @Valid is not working or what could be the reason. Downloaded your code also but same issue.

    • @vikasbagri1225
      @vikasbagri1225 Před rokem

      if you have found the solution then please let me know the solution. It would be very helpful.

    • @tuhinjana9853
      @tuhinjana9853 Před 11 měsíci

      How can you download the code ?

  • @shivdattbibhar_0734
    @shivdattbibhar_0734 Před rokem

    Those who getting zero errors check your dependencies properly

    • @vikasbagri1225
      @vikasbagri1225 Před rokem

      Validation is not able to catch the errors. I have checked the dependencies properly but nothing is working.
      Any help would be appreciated.

    • @nitintyagi1451
      @nitintyagi1451 Před rokem

      @@vikasbagri1225 use jakarta imports inplace of javax even in entity

    • @nitintyagi1451
      @nitintyagi1451 Před rokem

      @@vikasbagri1225 use jakarta imports inplace of javax even in entity

    • @RahulKumarYadav-jg9nb
      @RahulKumarYadav-jg9nb Před rokem +1

      ​@@vikasbagri1225 Use jakarta import in entity and controller

  • @gourvigupta4991
    @gourvigupta4991 Před rokem

    Sir bhot kuch try kr liya but validation nhii lgg rhi program me 😢
    Kyaa kree plzz reply

    • @user-xk4jh3lr7n
      @user-xk4jh3lr7n Před 10 měsíci +1

      just use spring boot starter validation dependency ONLY instead of using validation API and hibernate validator dependencies.

  • @Iimran786
    @Iimran786 Před 2 lety +1

    validation is not working after writing code

  • @karangupta5833
    @karangupta5833 Před 3 lety

    Sir this video is not running as well as not downloading

    • @LearnCodeWithDurgesh
      @LearnCodeWithDurgesh  Před 3 lety

      Re try bro...May be network issue

    • @karangupta5833
      @karangupta5833 Před 3 lety

      @@LearnCodeWithDurgesh ok sir done but can you please ccreate a video woth jsp pages not th: pages because my manager wants spring boot project with jsp please guide me

    • @karangupta5833
      @karangupta5833 Před 3 lety

      @@LearnCodeWithDurgesh atleast some basic information like crud , login with session, or jws or auth0 if igot that basic details so i can easily make a project with jsp pages

  • @jhonnysojo7703
    @jhonnysojo7703 Před rokem

    It is quite annoying when someone puts their video's title in English but ends up speaking Hindi or another language.

  • @sheru5307
    @sheru5307 Před 2 lety

    Bahot confusing hai video plzzz clear explain

  • @user-kw1id7jo2c
    @user-kw1id7jo2c Před 11 měsíci

    i am using jakarta package , but everythings same still i cant use @Valid
    anyone plese help me.....

    • @user-xk4jh3lr7n
      @user-xk4jh3lr7n Před 10 měsíci

      just use spring boot starter validation dependency ONLY instead of using validation API and hibernate validator dependencies.

    • @mohitgupta7841
      @mohitgupta7841 Před 6 měsíci

      Thanks bhai

    • @mohitgupta7841
      @mohitgupta7841 Před 6 měsíci

      Thanks bhai

  • @rahul-sinha
    @rahul-sinha Před 2 lety +10

    For those whose form validation is not working can directly include only this dependency in Pom.XML file :


    org.springframework.boot
    spring-boot-starter-validation

  • @pallavisharma6961
    @pallavisharma6961 Před rokem +1

    SIr this is not showing me errors while submitting blank data @PostMapping("/process")
    public String processForm(@Valid @ModelAttribute("loginData") LoginData loginData, BindingResult result){
    if(result.hasErrors()){
    System.out.println(result);
    return "form";
    }
    System.out.println(loginData);
    return "sucess";
    }

    • @rohanmahanti
      @rohanmahanti Před rokem

      I am also facing same problem. Even after submitting blank form getting this-- > org.springframework.validation.BeanPropertyBindingResult: 0 errors

    • @pallavisharma6961
      @pallavisharma6961 Před rokem

      @@rohanmahanti there was some library issue which I imported it has been fixed now. U should also check which version u r using

    • @user-kw1id7jo2c
      @user-kw1id7jo2c Před 11 měsíci

      @@pallavisharma6961 can you tell me your versions ?

    • @mokshmangal9308
      @mokshmangal9308 Před 10 měsíci

      ​@@pallavisharma6961can you please tell me which one

  • @ashutoshkumarpandey6866
    @ashutoshkumarpandey6866 Před 2 lety +1

    when i am using th:each tag ..then i am getting this error ---> 22-08-31 --09:07:49--.186 ERROR 20460 --- [nio-8181-exec-1] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8181-exec-1] Exception processing template "form": Exception evaluating SpringEL expression: "#fields.errors('username')" (template: "form" - line 29, col 11)
    org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "#fields.errors('username')" (template: "form" - line 29, col 11)
    anyone have any idea about this please help me out

    • @anushkanemishte4538
      @anushkanemishte4538 Před rokem

      Did it got solved pls tell me also

    • @surabhisahu1231
      @surabhisahu1231 Před rokem

      Did you find any solution?
      Please reply I also stucked with this error

    • @anushkanemishte4538
      @anushkanemishte4538 Před rokem

      @@surabhisahu1231 noooo yaaaar I drop the project 😔

    • @LearnCodeWithDurgesh
      @LearnCodeWithDurgesh  Před rokem

      Check thymleaf dependency and el in file

    • @surabhisahu1231
      @surabhisahu1231 Před rokem

      @@LearnCodeWithDurgesh just solved there is another one
      org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: "${#fields.hasErrors('userName')"

  • @gauravtyagi8687
    @gauravtyagi8687 Před 2 lety

    Hi Durgesh,
    When i am adding server side validation then i am not getting error on login page it redirecting me to
    Whitelabel Error Page
    This application has no explicit mapping for /error, so you are seeing this as a fallback.
    Wed Aug 31 18:51:48 IST 2022
    There was an unexpected error (type=Bad Request, status=400).
    Validation failed for object='loginData'. Error count: 3
    org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 3 errors
    Field error in object 'loginData' on field 'userName': rejected value []; codes [NotBlank.loginData.userName,NotBlank.userName,NotBlank.java.lang.String,NotBlank]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [loginData.userName,userName]; arguments []; default message [userName]]; default message [User Name can not be empty !!]
    Field error in object 'loginData' on field 'userName': rejected value []; codes [Size.loginData.userName,Size.userName,Size.java.lang.String,Size]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [loginData.userName,userName]; arguments []; default message [userName],12,3]; default message [User Name should be between 3-12 character only]
    Field error in object 'loginData' on field 'checkAggrement': rejected value [false]; codes [AssertTrue.loginData.checkAggrement,AssertTrue.checkAggrement,AssertTrue.boolean,AssertTrue]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [loginData.checkAggrement,checkAggrement]; arguments []; default message [checkAggrement]]; default message [Please accept the aggrement first]
    at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:175)
    at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:122)
    The error is correct but not allowing me to show that on login page