No video

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

  Рет қаралды 56,198

Java Techie

Java Techie

Күн бұрын

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...
PROMO CODE : Java40
Bean validation & exception handling video link :
• Spring Boot | REST API...
GitHub:
github.com/Jav...
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

Пікірлер: 75
@bhavikjoshi1060
@bhavikjoshi1060 Жыл бұрын
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 😊
@itsnarahari
@itsnarahari 2 жыл бұрын
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
@SuperHuman748
@SuperHuman748 2 ай бұрын
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.
@tararamgoyal2220
@tararamgoyal2220 2 жыл бұрын
Owsem content & explanation, thank for you Basant your all the efforts 😍❣
@abhishekomprakash4074
@abhishekomprakash4074 8 күн бұрын
Very nice demonstration about custom annotation. One question: The message has hard coded values for the employeeType. Later if we add new types in an enum then can we have the message dynamic so that it fetches the valid values from the enum itself?
@abhaymishra8112
@abhaymishra8112 Жыл бұрын
Yor are doing a good job to pick very interesting and useful topic.
@DiplomasizKodcu
@DiplomasizKodcu Жыл бұрын
Followed and liked. Thank you so much.
@sreddy8141
@sreddy8141 2 жыл бұрын
Good content 👍helpful. Thanks sir
@PappuKumar-ho3ek
@PappuKumar-ho3ek 2 жыл бұрын
Good topic....nicely explained 👏 👌 👍
@cosmicjava
@cosmicjava 6 ай бұрын
Nice lesson!
@rkm7184
@rkm7184 2 ай бұрын
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
@chapristuff8460
@chapristuff8460 2 жыл бұрын
Thanks for posting. Very informative.
@gopisambasivarao5282
@gopisambasivarao5282 Жыл бұрын
Great content.thanks Basant..
@rishabhsharma2024
@rishabhsharma2024 7 ай бұрын
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.
@crackrbiwithme3356
@crackrbiwithme3356 4 ай бұрын
Awesome content sir. Can we validate response body also?
@Javatechie
@Javatechie 4 ай бұрын
Yes we validate but the approach is not the same we need to use aop advice
@crackrbiwithme3356
@crackrbiwithme3356 4 ай бұрын
@@Javatechie thank you sir for giving me direction.
@crackrbiwithme3356
@crackrbiwithme3356 4 ай бұрын
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.
@vinodhreddy6227
@vinodhreddy6227 2 жыл бұрын
Same way one to many relationships, can you try once.. it will help
@Javatechie
@Javatechie 2 жыл бұрын
Hi vinodh already i uploaded this please check kzbin.info/www/bejne/bqLLknd4eK-bbKs
@vinodhreddy6227
@vinodhreddy6227 2 жыл бұрын
@@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 2 жыл бұрын
Ohh okay got you
@tradeinfo3897
@tradeinfo3897 11 ай бұрын
can anyone help me to validate xml request body against xsd
@stevegathara8885
@stevegathara8885 Жыл бұрын
You are a good tutor. Very clear. Thanks you!
@itsnarahari
@itsnarahari 2 жыл бұрын
Great content
@arvindpandey8793
@arvindpandey8793 Жыл бұрын
Great
@vitamin2845
@vitamin2845 2 жыл бұрын
Great tutorial, very helpful :)
@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 2 жыл бұрын
We can use pattern but it's not recommended you can use enum for fixed values and you can check
@ShinAkuma
@ShinAkuma Жыл бұрын
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
@amaljeevs4157
@amaljeevs4157 Жыл бұрын
Was Helpful❤
@itsnarahari
@itsnarahari 2 жыл бұрын
Great and clear content
@badriv.r453
@badriv.r453 Жыл бұрын
Nice & simple to understand
@codingmoments
@codingmoments 2 жыл бұрын
thnx for this video
@AllDetailsIKnow
@AllDetailsIKnow 8 ай бұрын
Thanks!
@nagareddy9744
@nagareddy9744 Жыл бұрын
Hello basanth...the exception you are getting MethodArgumentNotValidException....i am getting that
@rajasundarrajan2066
@rajasundarrajan2066 Жыл бұрын
Great , Thank you
@nitinbhattacharyya8784
@nitinbhattacharyya8784 Жыл бұрын
Can you tell me what is the use of @Documented? Also can you tell me what exactly those two lines you copied are doing?
@francovedia5584
@francovedia5584 Жыл бұрын
thanks
@sheikhmohduzair2886
@sheikhmohduzair2886 Жыл бұрын
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 Жыл бұрын
@@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 .
@niranjanvasadi8616
@niranjanvasadi8616 2 жыл бұрын
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.
@DurgaShiva7574
@DurgaShiva7574 2 жыл бұрын
1st like and comment ❤️
@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 ?
@niketagrawal1990
@niketagrawal1990 Жыл бұрын
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
@DeepakLalchandaniProfile
@DeepakLalchandaniProfile 10 ай бұрын
@javatechie is this validation included in your springboot course
@Javatechie
@Javatechie 10 ай бұрын
Yes I believe
@DeepakLalchandaniProfile
@DeepakLalchandaniProfile 10 ай бұрын
@@Javatechie under which section
@Javatechie
@Javatechie 10 ай бұрын
Bean validation
@DeepakLalchandaniProfile
@DeepakLalchandaniProfile 10 ай бұрын
​@@Javatechie thank you
@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?
@asadullahmonsur9136
@asadullahmonsur9136 2 жыл бұрын
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
@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 Жыл бұрын
Javax validation doesnt work now......To discover this I almost spent my whole day today
@Javatechie
@Javatechie Жыл бұрын
It should work . Will check and update
@satyanarayanamanchala6476
@satyanarayanamanchala6476 2 жыл бұрын
Can we use property file to read messages
@Javatechie
@Javatechie 2 жыл бұрын
Yes you can use
@rishiraj2548
@rishiraj2548 2 жыл бұрын
🙏👍
@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 Жыл бұрын
@@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.
@hamednikbakht9708
@hamednikbakht9708 2 жыл бұрын
hi please add subtitle
@Javatechie
@Javatechie 2 жыл бұрын
It will auto enabled
Touching Act of Kindness Brings Hope to the Homeless #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 17 МЛН
这三姐弟太会藏了!#小丑#天使#路飞#家庭#搞笑
00:24
家庭搞笑日记
Рет қаралды 118 МЛН
PEDRO PEDRO INSIDEOUT
00:10
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 24 МЛН
GTA 5 vs GTA San Andreas Doctors🥼🚑
00:57
Xzit Thamer
Рет қаралды 24 МЛН
Spring Annotations for Experienced Developers #springboot #java
10:51
Spring Boot Custom Validation Annotation (with parameters)
16:39
Spring boot @Autowired annotation with example
7:35
B2 Tech
Рет қаралды 52 М.
Touching Act of Kindness Brings Hope to the Homeless #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 17 МЛН