Spring Boot - Creating Custom Annotation For Validation | InterviewQA | JavaTechie

Sdílet
Vložit
  • čas přidán 15. 09. 2022
  • In this tutorial We will understand how to create custom annotation for bean validation in spring boot
    Spring boot microservice Live course Just started (Recordings available)
    Hurry-up & Register today itself!
    COURSE LINK : javatechie5246.ongraphy.com/
    PROMO CODE : Java40
    Bean validation & exception handling video link :
    • Spring Boot | REST API...
    GitHub:
    github.com/Java-Techie-jt/cus...
    Blogs:
    / javatechie
    Facebook:
    / javatechie
    guys if you like this video please do subscribe now and press the bell icon to not miss any update from Java Techie
    Disclaimer/Policy:
    --------------------------------
    Note : All uploaded content in this channel is mine and its not copied from any community ,
    you are free to use source code from above mentioned GitHub account
  • Věda a technologie

Komentáře • 73

  • @chapristuff8460
    @chapristuff8460 Před rokem +1

    Thanks for posting. Very informative.

  • @tararamgoyal2220
    @tararamgoyal2220 Před rokem +4

    Owsem content & explanation, thank for you Basant your all the efforts 😍❣

  • @vitamin2845
    @vitamin2845 Před rokem +2

    Great tutorial, very helpful :)

  • @sreddy8141
    @sreddy8141 Před rokem +1

    Good content 👍helpful. Thanks sir

  • @DiplomasizKodcu
    @DiplomasizKodcu Před rokem +1

    Followed and liked. Thank you so much.

  • @gopisambasivarao5282
    @gopisambasivarao5282 Před rokem +1

    Great content.thanks Basant..

  • @abhaymishra8112
    @abhaymishra8112 Před rokem +1

    Yor are doing a good job to pick very interesting and useful topic.

  • @SuperHuman748
    @SuperHuman748 Před dnem +1

    Hi
    Thanks 🙏👍
    Can u make a video on following list
    1. How to validate a list or a map of objects
    2. How to pass a validated list of allowed strings during entity creation itself.

  • @itsnarahari
    @itsnarahari Před rokem

    Great and clear content

  • @cosmicjava
    @cosmicjava Před 3 měsíci +1

    Nice lesson!

  • @amaljeevs4157
    @amaljeevs4157 Před rokem +1

    Was Helpful❤

  • @rajasundarrajan2066
    @rajasundarrajan2066 Před rokem

    Great , Thank you

  • @itsnarahari
    @itsnarahari Před rokem +1

    Great content

  • @stevegathara8885
    @stevegathara8885 Před 11 měsíci +1

    You are a good tutor. Very clear.
    Thanks you!

  • @itsnarahari
    @itsnarahari Před rokem +1

    We are only 3K subscriber for the century let's make all quickly by sharing this content everybody will subscribe after seeing this clear eplanation

  • @arvindpandey8793
    @arvindpandey8793 Před rokem +1

    Great

  • @codingmoments
    @codingmoments Před rokem +1

    thnx for this video

  • @PappuKumar-ho3ek
    @PappuKumar-ho3ek Před rokem +2

    Good topic....nicely explained 👏 👌 👍

  • @bhavikjoshi1060
    @bhavikjoshi1060 Před rokem +7

    Thank you so much for creating such great real world example. Very very helpful for me.
    I just want to request you that if you can create a video on how we can find performance issues in our application? That would be great help. I will appreciate it. Thanks again. 😊😊😊

  • @AllDetailsIKnow
    @AllDetailsIKnow Před 6 měsíci +1

    Thanks!

  • @badriv.r453
    @badriv.r453 Před rokem +1

    Nice & simple to understand

  • @francovedia5584
    @francovedia5584 Před rokem +1

    thanks

  • @DurgaShiva7574
    @DurgaShiva7574 Před rokem +1

    1st like and comment ❤️

  • @rishiraj2548
    @rishiraj2548 Před rokem +1

    🙏👍

  • @nguyendinhtoifplhn3443

    hello teacher, i am new to spring validation and i have encountered a problem that one of my data fields has type double and now i want to check when i enter a string or a character it will give an error format, but I have tried many times and failed, can you help me?

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

    can anyone help me to validate xml request body against xsd

  • @nagareddy9744
    @nagareddy9744 Před rokem

    Hello basanth...the exception you are getting MethodArgumentNotValidException....i am getting that

  • @asadullahmonsur9136
    @asadullahmonsur9136 Před rokem

    Is the any way to to disable scripts (java script ) requesting to server or disable json (use xml configuration instead) , similarly disable JS files in rendering to client . I am assuming environment is springboot application with pure java

  • @rishabhsharma2024
    @rishabhsharma2024 Před 4 měsíci

    can you make one more video on how to use group() and payload() method by example ,it would be great help ,i searched on internet but hard time to understanding proper usecases ,if anybody knows let me know.

  • @niranjanvasadi8616
    @niranjanvasadi8616 Před rokem

    Please explain how to handle request reject exception.I need to handle //(doubleslashes) in url when calling the api. I don't find any solution for this please explain.

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

    Can you tell me what is the use of @Documented? Also can you tell me what exactly those two lines you copied are doing?

  • @Cons2911
    @Cons2911 Před rokem

    Java’s is no longer included I think it the latest version of spring. If we add Java’s manually will it still work ?

  • @vinodhreddy6227
    @vinodhreddy6227 Před rokem +1

    Same way one to many relationships, can you try once.. it will help

    • @Javatechie
      @Javatechie  Před rokem +1

      Hi vinodh already i uploaded this please check czcams.com/video/8qhaDBCJh6I/video.html

    • @vinodhreddy6227
      @vinodhreddy6227 Před rokem +1

      @@Javatechie sorry may be not understood.. I'm asking one to many relationships using validator. Many relationships not working validation. Can you try once

    • @Javatechie
      @Javatechie  Před rokem

      Ohh okay got you

  • @crackrbiwithme3356
    @crackrbiwithme3356 Před 2 měsíci +1

    Awesome content sir. Can we validate response body also?

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

      Yes we validate but the approach is not the same we need to use aop advice

    • @crackrbiwithme3356
      @crackrbiwithme3356 Před 2 měsíci +1

      @@Javatechie thank you sir for giving me direction.

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

      Sir if it is possible, please upload one video for response validation also. In my current project I am dealing with lot of third party apis response and I need to validate them. It will be great help if you upload one video.

  • @satzcalvin
    @satzcalvin Před rokem +2

    Can we use @Pattern(regexp=“^[EMPLOYEE|VENDOR|CONTRACTOR]”)? It will be simple and one line instead of creating custom validation?

    • @itsnarahari
      @itsnarahari Před rokem

      We can use pattern but it's not recommended you can use enum for fixed values and you can check

    • @ShinAkuma
      @ShinAkuma Před rokem +2

      You can, but will you add this every time you need to perform this validation ?
      If in future you need to add 1 more value to the pattern, you will have to change this pattern in every single place you have used this.

    • @satzcalvin
      @satzcalvin Před rokem

      @@ShinAkuma Thanks for good example

  • @himanshutariyal7648
    @himanshutariyal7648 Před rokem

    Great video, just one question. Is the Javax bean validation and Jakarta bean validation same dependencies? The annotation is working with javax but not with jakarta. I checked maven repository and there it was mentioned that "Note Javax artifact was moved to Jakarta.validation ".

    • @Javatechie
      @Javatechie  Před rokem

      Not sure buddy needs to check.

    • @vishakhnaik2310
      @vishakhnaik2310 Před rokem

      yeah they moved all the classes of javax to jakrata now

    • @rahulbhagwat2182
      @rahulbhagwat2182 Před rokem +1

      Javax validation doesnt work now......To discover this I almost spent my whole day today

    • @Javatechie
      @Javatechie  Před rokem

      It should work . Will check and update

  • @satyanarayanamanchala6476

    Can we use property file to read messages

  • @vinodkumarreddy7696
    @vinodkumarreddy7696 Před rokem

    Hi Sir we have Employee class in dto we are using @notnull and @not empty ...it's working fine for all fields ...but my scenario is suppose if the user send pay load to controller based on user dept type I want to check only first and last name and for second user i dont need to check names but I need to check only email and password....is it possible here to validate like that or we need to write logics separately ?
    In this case always it will check the values for entire Employee class
    Can u plz advise ...thanks for the video

    • @Cons2911
      @Cons2911 Před rokem

      I know this is old but you can put your logic in the validator itself, you’ll have access to the object so you can check however you like

    • @samirpanda1147
      @samirpanda1147 Před rokem

      have you got any solution for this?

    • @Cons2911
      @Cons2911 Před rokem +1

      @@samirpanda1147 there’s a way to validate using code, and annotation. I forgot what it’s called but basically you get access to the fields using this validator so you can check for nulls or do whatever you need to do.
      Let me see if I can find out the proper term.

  • @niketagrawal1990
    @niketagrawal1990 Před rokem +1

    Cant we simply make the field as enum itself, it will do the work

    • @Javatechie
      @Javatechie  Před rokem

      Yes you can but user might give wrong value

  • @sheikhmohduzair2886
    @sheikhmohduzair2886 Před rokem +1

    create a video for validating List of object in springboot.

    • @Javatechie
      @Javatechie  Před rokem

      List of objects means you are talking about List employees or List

    • @sheikhmohduzair2886
      @sheikhmohduzair2886 Před rokem +1

      @@Javatechie Employee

    • @Javatechie
      @Javatechie  Před rokem

      Approach is the same only you need to pass an argument as a list of employees in the controller class that's it .

    • @sheikhmohduzair2886
      @sheikhmohduzair2886 Před rokem

      @@Javatechie i got a list of json request from client and if i have a controller for handling list of (suppose employee) object but my validation is for bean . when i validate it does not give the expected output . the response i am getting is also in the list of object.
      THE Approach you told does not work i have tried .

  • @DeepakLalchandaniProfile
    @DeepakLalchandaniProfile Před 8 měsíci +1

    @javatechie is this validation included in your springboot course

  • @hamednikbakht9708
    @hamednikbakht9708 Před rokem +1

    hi please add subtitle