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

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 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
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 74

  • @tararamgoyal2220
    @tararamgoyal2220 ปีที่แล้ว +4

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

  • @chapristuff8460
    @chapristuff8460 ปีที่แล้ว +1

    Thanks for posting. Very informative.

  • @DiplomasizKodcu
    @DiplomasizKodcu ปีที่แล้ว +1

    Followed and liked. Thank you so much.

  • @sreddy8141
    @sreddy8141 ปีที่แล้ว +1

    Good content 👍helpful. Thanks sir

  • @vitamin2845
    @vitamin2845 ปีที่แล้ว +2

    Great tutorial, very helpful :)

  • @abhaymishra8112
    @abhaymishra8112 ปีที่แล้ว +1

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

  • @itsnarahari
    @itsnarahari ปีที่แล้ว +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

  • @gopisambasivarao5282
    @gopisambasivarao5282 ปีที่แล้ว +1

    Great content.thanks Basant..

  • @cosmicjava
    @cosmicjava 4 หลายเดือนก่อน +1

    Nice lesson!

  • @itsnarahari
    @itsnarahari ปีที่แล้ว

    Great and clear content

  • @amaljeevs4157
    @amaljeevs4157 ปีที่แล้ว +1

    Was Helpful❤

  • @SuperHuman748
    @SuperHuman748 21 วันที่ผ่านมา +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.

  • @stevegathara8885
    @stevegathara8885 ปีที่แล้ว +1

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

  • @rajasundarrajan2066
    @rajasundarrajan2066 ปีที่แล้ว

    Great , Thank you

  • @itsnarahari
    @itsnarahari ปีที่แล้ว +1

    Great content

  • @PappuKumar-ho3ek
    @PappuKumar-ho3ek ปีที่แล้ว +2

    Good topic....nicely explained 👏 👌 👍

  • @bhavikjoshi1060
    @bhavikjoshi1060 ปีที่แล้ว +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. 😊😊😊

    • @Javatechie
      @Javatechie  ปีที่แล้ว

      Okay I will try that

    • @bhavikjoshi1060
      @bhavikjoshi1060 ปีที่แล้ว

      @@Javatechie thank you so much 😊

  • @codingmoments
    @codingmoments ปีที่แล้ว +1

    thnx for this video

  • @arvindpandey8793
    @arvindpandey8793 ปีที่แล้ว +1

    Great

  • @AllDetailsIKnow
    @AllDetailsIKnow 7 หลายเดือนก่อน +1

    Thanks!

  • @asadullahmonsur9136
    @asadullahmonsur9136 ปีที่แล้ว

    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

  • @nguyendinhtoifplhn3443
    @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 9 หลายเดือนก่อน +1

    can anyone help me to validate xml request body against xsd

  • @badriv.r453
    @badriv.r453 ปีที่แล้ว +1

    Nice & simple to understand

  • @niranjanvasadi8616
    @niranjanvasadi8616 ปีที่แล้ว

    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.

  • @francovedia5584
    @francovedia5584 ปีที่แล้ว +1

    thanks

  • @nagareddy9744
    @nagareddy9744 ปีที่แล้ว

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

  • @Cons2911
    @Cons2911 ปีที่แล้ว

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

  • @rishabhsharma2024
    @rishabhsharma2024 5 หลายเดือนก่อน

    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.

  • @nitinbhattacharyya8784
    @nitinbhattacharyya8784 11 หลายเดือนก่อน

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

  • @DurgaShiva7574
    @DurgaShiva7574 ปีที่แล้ว +1

    1st like and comment ❤️

  • @himanshutariyal7648
    @himanshutariyal7648 ปีที่แล้ว

    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  ปีที่แล้ว

      Not sure buddy needs to check.

    • @vishakhnaik2310
      @vishakhnaik2310 ปีที่แล้ว

      yeah they moved all the classes of javax to jakrata now

    • @rahulbhagwat2182
      @rahulbhagwat2182 ปีที่แล้ว +1

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

    • @Javatechie
      @Javatechie  ปีที่แล้ว

      It should work . Will check and update

  • @satzcalvin
    @satzcalvin ปีที่แล้ว +2

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

    • @itsnarahari
      @itsnarahari ปีที่แล้ว

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

    • @ShinAkuma
      @ShinAkuma ปีที่แล้ว +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 ปีที่แล้ว

      @@ShinAkuma Thanks for good example

  • @rishiraj2548
    @rishiraj2548 ปีที่แล้ว +1

    🙏👍

  • @vinodkumarreddy7696
    @vinodkumarreddy7696 ปีที่แล้ว

    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 ปีที่แล้ว

      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 ปีที่แล้ว

      have you got any solution for this?

    • @Cons2911
      @Cons2911 ปีที่แล้ว +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.

  • @rkm7184
    @rkm7184 17 วันที่ผ่านมา

    Instead of writing so much code to validate employee type, just create an Enum for Employee type with the required value and take reference of that Enum in employee request DTO

  • @crackrbiwithme3356
    @crackrbiwithme3356 3 หลายเดือนก่อน +1

    Awesome content sir. Can we validate response body also?

    • @Javatechie
      @Javatechie  3 หลายเดือนก่อน

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

    • @crackrbiwithme3356
      @crackrbiwithme3356 3 หลายเดือนก่อน +1

      @@Javatechie thank you sir for giving me direction.

    • @crackrbiwithme3356
      @crackrbiwithme3356 3 หลายเดือนก่อน

      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.

  • @satyanarayanamanchala6476
    @satyanarayanamanchala6476 ปีที่แล้ว +1

    Can we use property file to read messages

  • @DeepakLalchandaniProfile
    @DeepakLalchandaniProfile 9 หลายเดือนก่อน +1

    @javatechie is this validation included in your springboot course

  • @vinodhreddy6227
    @vinodhreddy6227 ปีที่แล้ว +1

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

    • @Javatechie
      @Javatechie  ปีที่แล้ว +1

      Hi vinodh already i uploaded this please check th-cam.com/video/8qhaDBCJh6I/w-d-xo.html

    • @vinodhreddy6227
      @vinodhreddy6227 ปีที่แล้ว +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  ปีที่แล้ว

      Ohh okay got you

  • @niketagrawal1990
    @niketagrawal1990 ปีที่แล้ว +1

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

    • @Javatechie
      @Javatechie  ปีที่แล้ว

      Yes you can but user might give wrong value

  • @sheikhmohduzair2886
    @sheikhmohduzair2886 ปีที่แล้ว +1

    create a video for validating List of object in springboot.

    • @Javatechie
      @Javatechie  ปีที่แล้ว

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

    • @sheikhmohduzair2886
      @sheikhmohduzair2886 ปีที่แล้ว +1

      @@Javatechie Employee

    • @Javatechie
      @Javatechie  ปีที่แล้ว

      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 ปีที่แล้ว

      @@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 .

  • @hamednikbakht9708
    @hamednikbakht9708 ปีที่แล้ว +1

    hi please add subtitle

    • @Javatechie
      @Javatechie  ปีที่แล้ว

      It will auto enabled